aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-02-11 20:02:55 +0100
committerLuke Dashjr <luke-jr+git@utopios.org>2012-02-17 09:38:13 -0500
commit43163a5a4d0fd3c849dbb2e7070b7ba4f7a70d27 (patch)
treeb77f074d668c1bb8c52012890532e5b57ea49e8d /src/util.h
parentd52397b3c02330d17cde6952e8bbc1c492c06007 (diff)
downloadbitcoin-43163a5a4d0fd3c849dbb2e7070b7ba4f7a70d27.tar.xz
Macros for manual critical sections
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index a48979c0ef..c4ee19fe01 100644
--- a/src/util.h
+++ b/src/util.h
@@ -254,6 +254,12 @@ public:
for (bool fcriticalblockonce=true; fcriticalblockonce; assert(("break caught by CRITICAL_BLOCK!" && !fcriticalblockonce)), fcriticalblockonce=false) \
for (CCriticalBlock criticalblock(cs, #cs, __FILE__, __LINE__); fcriticalblockonce; fcriticalblockonce=false)
+#define ENTER_CRITICAL_SECTION(cs) \
+ (cs).Enter(#cs, __FILE__, __LINE__)
+
+#define LEAVE_CRITICAL_SECTION(cs) \
+ (cs).Leave()
+
class CTryCriticalBlock
{
protected: