Changeset View
Changeset View
Standalone View
Standalone View
src/sync.h
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
* Wrapped boost mutex: supports recursive locking, but no waiting | * Wrapped boost mutex: supports recursive locking, but no waiting | ||||
* TODO: We should move away from using the recursive lock by default. | * TODO: We should move away from using the recursive lock by default. | ||||
*/ | */ | ||||
class CCriticalSection : public AnnotatedMixin<boost::recursive_mutex> { | class CCriticalSection : public AnnotatedMixin<boost::recursive_mutex> { | ||||
public: | public: | ||||
~CCriticalSection() { DeleteLock((void *)this); } | ~CCriticalSection() { DeleteLock((void *)this); } | ||||
}; | }; | ||||
typedef CCriticalSection CDynamicCriticalSection; | |||||
/** Wrapped boost mutex: supports waiting but not recursive locking */ | /** Wrapped boost mutex: supports waiting but not recursive locking */ | ||||
typedef AnnotatedMixin<boost::mutex> CWaitableCriticalSection; | typedef AnnotatedMixin<boost::mutex> CWaitableCriticalSection; | ||||
/** Just a typedef for boost::condition_variable, can be wrapped later if | /** Just a typedef for boost::condition_variable, can be wrapped later if | ||||
* desired */ | * desired */ | ||||
typedef boost::condition_variable CConditionVariable; | typedef boost::condition_variable CConditionVariable; | ||||
#ifdef DEBUG_LOCKCONTENTION | #ifdef DEBUG_LOCKCONTENTION | ||||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |