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

@ -194,8 +194,11 @@ using namespace Utility::DynamicMemory;
std::this_thread::sleep_for(std::chrono::milliseconds(w->msec)); 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(); std::this_thread::yield();
} }
}
static void ThreadingFunction(ThreadData* w) static void ThreadingFunction(ThreadData* w)
{ {
CheckStatus(w); CheckStatus(w);