a small thread synchronization speedup for dual core mode.

it's most noticeable in games where the CPU is running behind compared to the GPU.
This commit is contained in:
nitsuja 2012-01-07 20:22:48 -08:00
parent b33be736cd
commit daefb3b550
2 changed files with 13 additions and 5 deletions

View File

@ -279,7 +279,7 @@ namespace this_thread
inline void yield()
{
#ifdef _WIN32
Sleep(0);
SwitchToThread();
#else
sleep(0);
#endif

View File

@ -171,14 +171,22 @@ void RunGpuLoop()
CommandProcessor::isPossibleWaitingSetDrawDone = false;
}
fifo.isGpuReadingData = false;
if (EmuRunningState)
Common::YieldCPU();
{
if (fifo.isGpuReadingData)
{
fifo.isGpuReadingData = false;
Common::YieldCPU();
}
else
{
SLEEP(1);
}
}
else
{
// While the emu is paused, we still handle async request such as Savestates then sleep.
fifo.isGpuReadingData = false;
while (!EmuRunningState)
{
g_video_backend->PeekMessages();