diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-09-01 14:17:25 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-09-01 14:42:00 +0200 |
| commit | 0e563d89c07573d56885f69e44adf9c28247b917 (patch) | |
| tree | cb3e7ae8e1ac2389e2f9577d21a053b6a629193d /src | |
| parent | Merge #8640: [depends] Remove Qt46 package (diff) | |
| parent | Do not shadow LOCK's criticalblock variable for LOCK inside LOCK (diff) | |
| download | discoin-0e563d89c07573d56885f69e44adf9c28247b917.tar.xz discoin-0e563d89c07573d56885f69e44adf9c28247b917.zip | |
Merge #8472: Do not shadow LOCK's criticalblock variable for LOCK inside LOCK
33d15a3 Do not shadow LOCK's criticalblock variable for LOCK inside LOCK (Pavel JanÃk)
Diffstat (limited to 'src')
| -rw-r--r-- | src/sync.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sync.h b/src/sync.h index 0c58fb6b4..773391074 100644 --- a/src/sync.h +++ b/src/sync.h @@ -171,7 +171,10 @@ public: typedef CMutexLock<CCriticalSection> CCriticalBlock; -#define LOCK(cs) CCriticalBlock criticalblock(cs, #cs, __FILE__, __LINE__) +#define PASTE(x, y) x ## y +#define PASTE2(x, y) PASTE(x, y) + +#define LOCK(cs) CCriticalBlock PASTE2(criticalblock, __COUNTER__)(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) |