Removing uses of Sleep/SwitchToThread/etc.
This commit is contained in:
@@ -32,7 +32,7 @@ XXMPApp::XXMPApp(KernelState* kernel_state)
|
||||
X_RESULT XXMPApp::XMPGetStatus(uint32_t state_ptr) {
|
||||
// Some stupid games will hammer this on a thread - induce a delay
|
||||
// here to keep from starving real threads.
|
||||
Sleep(1);
|
||||
xe::threading::Sleep(std::chrono::milliseconds::duration(1));
|
||||
|
||||
XELOGD("XMPGetStatus(%.8X)", state_ptr);
|
||||
xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(state_ptr),
|
||||
|
||||
@@ -345,7 +345,7 @@ SHIM_CALL XMABlockWhileInUse_shim(PPCContext* ppc_context,
|
||||
if (!context.input_buffer_0_valid && !context.input_buffer_1_valid) {
|
||||
break;
|
||||
}
|
||||
Sleep(1);
|
||||
xe::threading::Sleep(std::chrono::milliseconds::duration(1));
|
||||
} while (true);
|
||||
|
||||
SHIM_SET_RETURN_32(0);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "xenia/base/atomic.h"
|
||||
#include "xenia/base/logging.h"
|
||||
#include "xenia/base/string.h"
|
||||
#include "xenia/base/threading.h"
|
||||
#include "xenia/kernel/kernel_state.h"
|
||||
#include "xenia/kernel/xboxkrnl_private.h"
|
||||
#include "xenia/kernel/objects/xthread.h"
|
||||
@@ -398,7 +399,7 @@ spin:
|
||||
// TODO(benvanik): contention - do a real wait!
|
||||
// XELOGE("RtlEnterCriticalSection tried to really lock!");
|
||||
spin_wait_remaining = 0; // HACK: spin forever
|
||||
SwitchToThread();
|
||||
xe::threading::MaybeYield();
|
||||
goto spin;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user