X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Futil.h;h=c3a0efe0a76715e87f9813e3a37e46d652e35b2a;hb=8f9123a157d0ef479f62eb3e05da2ba6613c5dfc;hp=5f8d0375da5dde3261867e3ec9863cefaec87c44;hpb=8ff1873096d29a105ea98d6cd03c4f8f7b9cea0f;p=novacoin.git diff --git a/src/util.h b/src/util.h index 5f8d037..c3a0efe 100644 --- a/src/util.h +++ b/src/util.h @@ -274,8 +274,9 @@ typedef CMutexLock CWaitableCriticalBlock; typedef boost::interprocess::interprocess_condition CConditionVariable; /** Wait for a given condition inside a WAITABLE_CRITICAL_BLOCK */ +/** Sleep(1) is to workaround a 100% cpu-usage bug on OSX **/ #define WAIT(name,condition) \ - do { while(!(condition)) { (name).wait(waitablecriticalblock.GetLock()); } } while(0) + do { while(!(condition)) { (name).wait(waitablecriticalblock.GetLock()); Sleep(1);} } while(0) /** Notify waiting threads that a condition may hold now */ #define NOTIFY(name) \