aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-02-11 20:02:55 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2012-02-11 21:59:33 +0100
commit88bc5f94852a0b2839a3ef4e1a6a5168d02f6b55 (patch)
treeaf95db0a5e8bfc151165a0958956710e5b3c8e5d /src/util.h
parentb25474d1bea42ab6e20fb2b86714db0ece8f1c74 (diff)
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 8dcedb147b..ddc8791b38 100644
--- a/src/util.h
+++ b/src/util.h
@@ -218,6 +218,12 @@ public:
#define CRITICAL_BLOCK(cs) \
if (CCriticalBlock criticalblock = CCriticalBlock(cs, #cs, __FILE__, __LINE__))
+#define ENTER_CRITICAL_SECTION(cs) \
+ (cs).Enter(#cs, __FILE__, __LINE__)
+
+#define LEAVE_CRITICAL_SECTION(cs) \
+ (cs).Leave()
+
class CTryCriticalBlock
{
protected: