]> Git Repo - VerusCoin.git/commitdiff
Make -DDEBUGLOCKORDER + -debug less noisy
authorGavin Andresen <[email protected]>
Sun, 20 Oct 2013 05:41:15 +0000 (15:41 +1000)
committerGavin Andresen <[email protected]>
Sun, 20 Oct 2013 05:41:15 +0000 (15:41 +1000)
Print out every mutex lock/unlock if compiled -DDEBUGLOCKORDER
only if -debug=lock is set.

src/sync.cpp

index 29a455f9b255231b1cced41b408692bf0b61294e..d6444141dc5b94d146413ce1331b541d19cc235e 100644 (file)
@@ -78,7 +78,7 @@ static void push_lock(void* c, const CLockLocation& locklocation, bool fTry)
     if (lockstack.get() == NULL)
         lockstack.reset(new LockStack);
 
-    if (fDebug) LogPrintf("Locking: %s\n", locklocation.ToString().c_str());
+    LogPrint("lock", "Locking: %s\n", locklocation.ToString().c_str());
     dd_mutex.lock();
 
     (*lockstack).push_back(std::make_pair(c, locklocation));
@@ -108,7 +108,7 @@ static void pop_lock()
     if (fDebug)
     {
         const CLockLocation& locklocation = (*lockstack).rbegin()->second;
-        LogPrintf("Unlocked: %s\n", locklocation.ToString().c_str());
+        LogPrint("lock", "Unlocked: %s\n", locklocation.ToString().c_str());
     }
     dd_mutex.lock();
     (*lockstack).pop_back();
This page took 0.025147 seconds and 4 git commands to generate.