Anoncoin  0.9.4
P2P Digital Currency
Classes | Macros | Typedefs
sync.h File Reference
#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>
Include dependency graph for sync.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  AnnotatedMixin< PARENT >
 
class  CMutexLock< Mutex >
 Wrapper around boost::unique_lock<Mutex> More...
 
class  CSemaphore
 
class  CSemaphoreGrant
 RAII-style semaphore lock. More...
 

Macros

#define AssertLockHeld(cs)   AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
 
#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 ENTER_CRITICAL_SECTION(cs)
 
#define LEAVE_CRITICAL_SECTION(cs)
 

Typedefs

typedef AnnotatedMixin< boost::recursive_mutex > CCriticalSection
 Wrapped boost mutex: supports recursive locking, but no waiting. More...
 
typedef AnnotatedMixin< boost::mutex > CWaitableCriticalSection
 Wrapped boost mutex: supports waiting but not recursive locking. More...
 
typedef CMutexLock< CCriticalSectionCCriticalBlock
 

Macro Definition Documentation

#define AssertLockHeld (   cs)    AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)

Definition at line 98 of file sync.h.

#define ENTER_CRITICAL_SECTION (   cs)
Value:
{ \
EnterCritical(#cs, __FILE__, __LINE__, (void*)(&cs)); \
(cs).lock(); \
}

Definition at line 161 of file sync.h.

#define LEAVE_CRITICAL_SECTION (   cs)
Value:
{ \
(cs).unlock(); \
LeaveCritical(); \
}

Definition at line 167 of file sync.h.

#define LOCK (   cs)    CCriticalBlock criticalblock(cs, #cs, __FILE__, __LINE__)

Definition at line 157 of file sync.h.

#define LOCK2 (   cs1,
  cs2 
)    CCriticalBlock criticalblock1(cs1, #cs1, __FILE__, __LINE__),criticalblock2(cs2, #cs2, __FILE__, __LINE__)

Definition at line 158 of file sync.h.

#define TRY_LOCK (   cs,
  name 
)    CCriticalBlock name(cs, #cs, __FILE__, __LINE__, true)

Definition at line 159 of file sync.h.

Typedef Documentation

Definition at line 155 of file sync.h.

typedef AnnotatedMixin<boost::recursive_mutex> CCriticalSection

Wrapped boost mutex: supports recursive locking, but no waiting.

Definition at line 83 of file sync.h.

Wrapped boost mutex: supports waiting but not recursive locking.

Definition at line 86 of file sync.h.