From 3c3f9d3fea87fa2cebe6908b5cb43876dcf45c89 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 12 Apr 2013 18:36:03 -0700 Subject: [PATCH] Add a way to test if the master lock is held by someone else. --- src/cpp/ripple/Application.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cpp/ripple/Application.h b/src/cpp/ripple/Application.h index 2a848ed7c..c8492e02a 100644 --- a/src/cpp/ripple/Application.h +++ b/src/cpp/ripple/Application.h @@ -149,6 +149,13 @@ public: void run(); void stop(); void sweep(); + +#ifdef DEBUG + void mustHaveMasterLock() { bool tl = mMasterLock.try_lock(); assert(tl); mMasterLock.unlock(); } +#else + void mustHaveMasterLock() { ; } +#endif + }; extern Application* theApp;