aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-05-09 18:24:34 -0400
committerGavin Andresen <gavinandresen@gmail.com>2012-05-09 18:58:38 -0400
commit8f9123a157d0ef479f62eb3e05da2ba6613c5dfc (patch)
tree02498391205de5a076084c1da80bd9a23744971a
parent8ff1873096d29a105ea98d6cd03c4f8f7b9cea0f (diff)
Fix 100% cpu usage on osx bugv0.6.2.1
-rw-r--r--src/util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index 5f8d0375da..c3a0efe0a7 100644
--- a/src/util.h
+++ b/src/util.h
@@ -274,8 +274,9 @@ typedef CMutexLock<CWaitableCriticalSection> 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) \