When OysterThread was idle it was using a lot of cpu power.

This commit is contained in:
Pontus Fransson 2014-02-23 22:06:18 +01:00
parent 0cb7940bae
commit 203220f43b
1 changed files with 4 additions and 1 deletions

View File

@ -193,8 +193,11 @@ using namespace Utility::DynamicMemory;
if(w->msec > 0)
std::this_thread::sleep_for(std::chrono::milliseconds(w->msec));
while (w->state == OYSTER_THREAD_STATE_IDLE)
while (w->state == OYSTER_THREAD_STATE_IDLE)
{
CheckPriority(w);
std::this_thread::yield();
}
}
static void ThreadingFunction(ThreadData* w)
{