X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Futil.h;h=f90b95b9d57e76d4ab8db141b7f488f2dd0a9419;hb=ca0816152d91c929b51b2f644fcb9a69797a49fa;hp=6c3e6c5450e522430fed7ca96eeb676fc686dba1;hpb=c2e8c8acd8ae0c94c70b59f55169841ad195bb99;p=novacoin.git diff --git a/src/util.h b/src/util.h index 6c3e6c5..f90b95b 100644 --- a/src/util.h +++ b/src/util.h @@ -23,7 +23,7 @@ typedef int pid_t; /* define for windows compatiblity */ #include #include #include -#include +#include #include #include #include @@ -270,24 +270,10 @@ public: }; typedef CMutexLock CCriticalBlock; -typedef CMutexLock CWaitableCriticalBlock; -typedef boost::interprocess::interprocess_condition CConditionVariable; - -/** Wait for a given condition inside a WAITABLE_CRITICAL_BLOCK */ -#define WAIT(name,condition) \ - do { while(!(condition)) { (name).wait(waitablecriticalblock.GetLock()); } } while(0) - -/** Notify waiting threads that a condition may hold now */ -#define NOTIFY(name) \ - do { (name).notify_one(); } while(0) - -#define NOTIFY_ALL(name) \ - do { (name).notify_all(); } while(0) #define LOCK(cs) CCriticalBlock criticalblock(cs, #cs, __FILE__, __LINE__) #define LOCK2(cs1,cs2) CCriticalBlock criticalblock1(cs1, #cs1, __FILE__, __LINE__),criticalblock2(cs2, #cs2, __FILE__, __LINE__) #define TRY_LOCK(cs,name) CCriticalBlock name(cs, #cs, __FILE__, __LINE__, true) -#define WAITABLE_LOCK(cs) CWaitableCriticalBlock waitablecriticalblock(cs, #cs, __FILE__, __LINE__) #define ENTER_CRITICAL_SECTION(cs) \ { \ @@ -301,14 +287,7 @@ typedef boost::interprocess::interprocess_condition CConditionVariable; LeaveCritical(); \ } - -// This is exactly like std::string, but with a custom allocator. -// (secure_allocator<> is defined in serialize.h) -typedef std::basic_string, secure_allocator > SecureString; - - - - +typedef boost::interprocess::interprocess_semaphore CSemaphore; inline std::string i64tostr(int64 n) {