#include <threadsafety.h>
#include <condition_variable>
#include <thread>
#include <mutex>
Go to the source code of this file.
|
#define | AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs) |
|
#define | AssertLockNotHeld(cs) AssertLockNotHeldInternal(#cs, __FILE__, __LINE__, &cs) |
|
#define | PASTE(x, y) x ## y |
|
#define | PASTE2(x, y) PASTE(x, y) |
|
#define | LOCK(cs) DebugLock<decltype(cs)> PASTE2(criticalblock, __COUNTER__)(cs, #cs, __FILE__, __LINE__) |
|
#define | LOCK2(cs1, cs2) |
|
#define | TRY_LOCK(cs, name) DebugLock<decltype(cs)> name(cs, #cs, __FILE__, __LINE__, true) |
|
#define | WAIT_LOCK(cs, name) DebugLock<decltype(cs)> name(cs, #cs, __FILE__, __LINE__) |
|
#define | ENTER_CRITICAL_SECTION(cs) |
|
#define | LEAVE_CRITICAL_SECTION(cs) |
|
|
typedef AnnotatedMixin< std::recursive_mutex > | CCriticalSection |
| Wrapped mutex: supports recursive locking, but no waiting TODO: We should move away from using the recursive lock by default. More...
|
|
typedef AnnotatedMixin< std::mutex > | Mutex |
| Wrapped mutex: supports waiting but not recursive locking. More...
|
|
template<typename MutexArg > |
using | DebugLock = UniqueLock< typename std::remove_reference< typename std::remove_pointer< MutexArg >::type >::type > |
|
◆ AssertLockHeld
#define AssertLockHeld |
( |
|
cs | ) |
AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs) |
◆ AssertLockNotHeld
#define AssertLockNotHeld |
( |
|
cs | ) |
AssertLockNotHeldInternal(#cs, __FILE__, __LINE__, &cs) |
◆ ENTER_CRITICAL_SECTION
#define ENTER_CRITICAL_SECTION |
( |
|
cs | ) |
|
Value:{ \
EnterCritical(#cs, __FILE__, __LINE__, (void*)(&cs)); \
(cs).lock(); \
}
Definition at line 188 of file sync.h.
◆ LEAVE_CRITICAL_SECTION
#define LEAVE_CRITICAL_SECTION |
( |
|
cs | ) |
|
Value:{ \
(cs).unlock(); \
LeaveCritical(); \
}
Definition at line 194 of file sync.h.
◆ LOCK
#define LOCK |
( |
|
cs | ) |
DebugLock<decltype(cs)> PASTE2(criticalblock, __COUNTER__)(cs, #cs, __FILE__, __LINE__) |
◆ LOCK2
#define LOCK2 |
( |
|
cs1, |
|
|
|
cs2 |
|
) |
| |
Value: DebugLock<decltype(cs2)> criticalblock2(cs2, #cs2, __FILE__, __LINE__);
Wrapper around std::unique_lock style lock for Mutex.
Definition at line 182 of file sync.h.
◆ PASTE
#define PASTE |
( |
|
x, |
|
|
|
y |
|
) |
| x ## y |
◆ PASTE2
#define PASTE2 |
( |
|
x, |
|
|
|
y |
|
) |
| PASTE(x, y) |
◆ TRY_LOCK
#define TRY_LOCK |
( |
|
cs, |
|
|
|
name |
|
) |
| DebugLock<decltype(cs)> name(cs, #cs, __FILE__, __LINE__, true) |
◆ WAIT_LOCK
#define WAIT_LOCK |
( |
|
cs, |
|
|
|
name |
|
) |
| DebugLock<decltype(cs)> name(cs, #cs, __FILE__, __LINE__) |
◆ CCriticalSection
Wrapped mutex: supports recursive locking, but no waiting TODO: We should move away from using the recursive lock by default.
Definition at line 107 of file sync.h.
◆ DebugLock
template<typename MutexArg >
using DebugLock = UniqueLock<typename std::remove_reference<typename std::remove_pointer<MutexArg>::type>::type> |
◆ Mutex
Wrapped mutex: supports waiting but not recursive locking.
Definition at line 110 of file sync.h.