Changeset View
Changeset View
Standalone View
Standalone View
src/sync.h
Show First 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | private: | ||||
std::string lockname; | std::string lockname; | ||||
const std::string file; | const std::string file; | ||||
const int line; | const int line; | ||||
}; | }; | ||||
friend class reverse_lock; | friend class reverse_lock; | ||||
}; | }; | ||||
#define REVERSE_LOCK(g) \ | #define REVERSE_LOCK(g) \ | ||||
decltype(g)::reverse_lock PASTE2(revlock, __COUNTER__)(g, #g, __FILE__, \ | typename std::decay<decltype(g)>::type::reverse_lock PASTE2( \ | ||||
__LINE__) | revlock, __COUNTER__)(g, #g, __FILE__, __LINE__) | ||||
template <typename MutexArg> | template <typename MutexArg> | ||||
using DebugLock = UniqueLock<typename std::remove_reference< | using DebugLock = UniqueLock<typename std::remove_reference< | ||||
typename std::remove_pointer<MutexArg>::type>::type>; | typename std::remove_pointer<MutexArg>::type>::type>; | ||||
#define LOCK(cs) \ | #define LOCK(cs) \ | ||||
DebugLock<decltype(cs)> PASTE2(criticalblock, \ | DebugLock<decltype(cs)> PASTE2(criticalblock, \ | ||||
__COUNTER__)(cs, #cs, __FILE__, __LINE__) | __COUNTER__)(cs, #cs, __FILE__, __LINE__) | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |