Check for null string passed to Win32Thread::set_name
Move impl of XamAlloc into XamAllocImpl Implement XamAllocEx Implement XamIsCurrentTitleDash Implement XamGetLocaleDateFormat Implement "stub" of XFileFsDeviceInformation, XFileSectorInformation (log warnings when they're executed so this doesnt get mistaken for an actual implementation) Added xboxkrnl_memory file Moved meat of MmAllocatePhysicalMemoryEx into xeMmAllocatePhysicalMemoryEx, exposed its definition via xboxkrnl_memory. Moved impl of RtlImageHeaderNt into a helper function Implement RtlImageDirectoryEntryToData Implement KeSuspendThread Check for bad handles passed in XOVERLAPPED, fixes crash in 415608D8
This commit is contained in:
@@ -149,10 +149,11 @@ void MaybeYield() {
|
||||
// MemoryBarrier();
|
||||
}
|
||||
void NanoSleep(int64_t ns) {
|
||||
//nanosleep is done in 100 nanosecond increments
|
||||
// nanosleep is done in 100 nanosecond increments
|
||||
int64_t in_nt_increments = ns / 100LL;
|
||||
if (in_nt_increments == 0 && ns != 0) {
|
||||
//if we're explicitly requesting a delay of 0 ns, let it go through, otherwise if it was less than a 100ns increment we round up to 100ns
|
||||
// if we're explicitly requesting a delay of 0 ns, let it go through,
|
||||
// otherwise if it was less than a 100ns increment we round up to 100ns
|
||||
in_nt_increments = 1;
|
||||
}
|
||||
in_nt_increments = -in_nt_increments;
|
||||
@@ -514,6 +515,10 @@ class Win32Thread : public Win32Handle<Thread> {
|
||||
~Win32Thread() = default;
|
||||
|
||||
void set_name(std::string name) override {
|
||||
// this can actually happen in some debug builds
|
||||
if (&name == nullptr) {
|
||||
return;
|
||||
}
|
||||
xe::threading::set_name(handle_, name);
|
||||
Thread::set_name(name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user