From 203220f43b6f2e517bbb8a78e852321dbb3c4763 Mon Sep 17 00:00:00 2001 From: Pontus Fransson Date: Sun, 23 Feb 2014 22:06:18 +0100 Subject: [PATCH] When OysterThread was idle it was using a lot of cpu power. --- Code/Misc/Utilities/Thread/OysterThread_Impl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Code/Misc/Utilities/Thread/OysterThread_Impl.cpp b/Code/Misc/Utilities/Thread/OysterThread_Impl.cpp index 91430eab..e2809c4f 100644 --- a/Code/Misc/Utilities/Thread/OysterThread_Impl.cpp +++ b/Code/Misc/Utilities/Thread/OysterThread_Impl.cpp @@ -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) {