diff options
Diffstat (limited to 'src/sync.h')
-rw-r--r-- | src/sync.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/sync.h b/src/sync.h index 3b29050e0e..0871c5fb4d 100644 --- a/src/sync.h +++ b/src/sync.h @@ -9,7 +9,6 @@ #include "threadsafety.h" #include <boost/thread/condition_variable.hpp> -#include <boost/thread/locks.hpp> #include <boost/thread/mutex.hpp> #include <boost/thread/recursive_mutex.hpp> @@ -97,7 +96,6 @@ public: } }; -typedef CCriticalSection CDynamicCriticalSection; /** Wrapped boost mutex: supports waiting but not recursive locking */ typedef AnnotatedMixin<boost::mutex> CWaitableCriticalSection; @@ -198,7 +196,7 @@ private: int value; public: - CSemaphore(int init) : value(init) {} + explicit CSemaphore(int init) : value(init) {} void wait() { @@ -267,9 +265,9 @@ public: fHaveGrant = false; } - CSemaphoreGrant() : sem(NULL), fHaveGrant(false) {} + CSemaphoreGrant() : sem(nullptr), fHaveGrant(false) {} - CSemaphoreGrant(CSemaphore& sema, bool fTry = false) : sem(&sema), fHaveGrant(false) + explicit CSemaphoreGrant(CSemaphore& sema, bool fTry = false) : sem(&sema), fHaveGrant(false) { if (fTry) TryAcquire(); @@ -282,7 +280,7 @@ public: Release(); } - operator bool() + operator bool() const { return fHaveGrant; } |