mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
refactor: consolidate PASTE macros
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#define BITCOIN_SYNC_H
|
||||
|
||||
#include <threadsafety.h>
|
||||
#include <util/macros.h>
|
||||
|
||||
#include <condition_variable>
|
||||
#include <thread>
|
||||
@@ -176,9 +177,6 @@ public:
|
||||
template<typename MutexArg>
|
||||
using DebugLock = UniqueLock<typename std::remove_reference<typename std::remove_pointer<MutexArg>::type>::type>;
|
||||
|
||||
#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) \
|
||||
DebugLock<decltype(cs1)> criticalblock1(cs1, #cs1, __FILE__, __LINE__); \
|
||||
|
||||
Reference in New Issue
Block a user