Fixing misuse of std::chrono.

This commit is contained in:
Ben Vanik 2015-08-18 10:18:30 -07:00
parent 2820ff85e5
commit ad090a40eb
7 changed files with 7 additions and 8 deletions

View File

@ -143,7 +143,7 @@ void AudioSystem::WorkerThreadMain() {
if (!pumped) { if (!pumped) {
SCOPE_profile_cpu_i("apu", "Sleep"); SCOPE_profile_cpu_i("apu", "Sleep");
xe::threading::Sleep(std::chrono::milliseconds::duration(500)); xe::threading::Sleep(std::chrono::milliseconds(500));
} }
} }
worker_running_ = false; worker_running_ = false;

View File

@ -1104,8 +1104,7 @@ bool CommandProcessor::ExecutePacketType3_WAIT_REG_MEM(RingbufferReader* reader,
// User wants it fast and dangerous. // User wants it fast and dangerous.
xe::threading::MaybeYield(); xe::threading::MaybeYield();
} else { } else {
xe::threading::Sleep( xe::threading::Sleep(std::chrono::milliseconds(wait / 0x100));
std::chrono::milliseconds::duration(wait / 0x100));
} }
xe::threading::SyncMemory(); xe::threading::SyncMemory();
ReturnFromWait(); ReturnFromWait();

View File

@ -126,7 +126,7 @@ X_STATUS GL4GraphicsSystem::Setup(cpu::Processor* processor,
MarkVblank(); MarkVblank();
last_frame_time = current_time; last_frame_time = current_time;
} }
xe::threading::Sleep(std::chrono::milliseconds::duration(1)); xe::threading::Sleep(std::chrono::milliseconds(1));
} }
return 0; return 0;
})); }));

View File

@ -32,7 +32,7 @@ XXMPApp::XXMPApp(KernelState* kernel_state)
X_RESULT XXMPApp::XMPGetStatus(uint32_t state_ptr) { X_RESULT XXMPApp::XMPGetStatus(uint32_t state_ptr) {
// Some stupid games will hammer this on a thread - induce a delay // Some stupid games will hammer this on a thread - induce a delay
// here to keep from starving real threads. // here to keep from starving real threads.
xe::threading::Sleep(std::chrono::milliseconds::duration(1)); xe::threading::Sleep(std::chrono::milliseconds(1));
XELOGD("XMPGetStatus(%.8X)", state_ptr); XELOGD("XMPGetStatus(%.8X)", state_ptr);
xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(state_ptr), xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(state_ptr),

View File

@ -585,7 +585,7 @@ void KernelState::CompleteOverlappedDeferredEx(
dispatch_queue_.push_back([this, completion_callback, overlapped_ptr, result, dispatch_queue_.push_back([this, completion_callback, overlapped_ptr, result,
extended_error, length]() { extended_error, length]() {
xe::threading::Sleep( xe::threading::Sleep(
std::chrono::milliseconds::duration(kDeferredOverlappedDelayMillis)); std::chrono::milliseconds(kDeferredOverlappedDelayMillis));
completion_callback(); completion_callback();
CompleteOverlappedEx(overlapped_ptr, result, extended_error, length); CompleteOverlappedEx(overlapped_ptr, result, extended_error, length);
}); });

View File

@ -409,7 +409,7 @@ void XThread::Execute() {
// All threads get a mandatory sleep. This is to deal with some buggy // All threads get a mandatory sleep. This is to deal with some buggy
// games that are assuming the 360 is so slow to create threads that they // games that are assuming the 360 is so slow to create threads that they
// have time to initialize shared structures AFTER CreateThread (RR). // have time to initialize shared structures AFTER CreateThread (RR).
xe::threading::Sleep(std::chrono::milliseconds::duration(100)); xe::threading::Sleep(std::chrono::milliseconds(100));
int exit_code = 0; int exit_code = 0;

View File

@ -346,7 +346,7 @@ SHIM_CALL XMABlockWhileInUse_shim(PPCContext* ppc_context,
if (!context.input_buffer_0_valid && !context.input_buffer_1_valid) { if (!context.input_buffer_0_valid && !context.input_buffer_1_valid) {
break; break;
} }
xe::threading::Sleep(std::chrono::milliseconds::duration(1)); xe::threading::Sleep(std::chrono::milliseconds(1));
} while (true); } while (true);
SHIM_SET_RETURN_32(0); SHIM_SET_RETURN_32(0);