Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Classes | Macros | Typedefs
sync.h File Reference
#include <boost/thread/mutex.hpp>
#include <boost/thread/recursive_mutex.hpp>
#include <boost/thread/locks.hpp>
#include <boost/thread/condition_variable.hpp>
#include "threadsafety.h"
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 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
< CCriticalSection
CCriticalBlock
 

Macro Definition Documentation

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

Definition at line 112 of file sync.h.

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

Definition at line 118 of file sync.h.

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

Definition at line 108 of file sync.h.

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

Definition at line 109 of file sync.h.

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

Definition at line 110 of file sync.h.

Typedef Documentation

Definition at line 106 of file sync.h.

typedef AnnotatedMixin<boost::recursive_mutex> CCriticalSection

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

Definition at line 38 of file sync.h.

Wrapped boost mutex: supports waiting but not recursive locking.

Definition at line 41 of file sync.h.