diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-09-18 20:38:08 +1000 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-09-18 20:39:25 +1000 |
commit | 881a85a22d76c875f519cd54388a419ec6f70857 (patch) | |
tree | 3f71daa59ac35c5dda44747c0b62dbc8602d8f1c /src/sync.cpp | |
parent | e51321fb75f00194425e5ecc8ad77fd6762ec221 (diff) |
Replace printf with LogPrintf / LogPrint
Diffstat (limited to 'src/sync.cpp')
-rw-r--r-- | src/sync.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/sync.cpp b/src/sync.cpp index 1ac4403beb..29a455f9b2 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -10,8 +10,8 @@ #ifdef DEBUG_LOCKCONTENTION void PrintLockContention(const char* pszName, const char* pszFile, int nLine) { - printf("LOCKCONTENTION: %s\n", pszName); - printf("Locker: %s:%d\n", pszFile, nLine); + LogPrintf("LOCKCONTENTION: %s\n", pszName); + LogPrintf("Locker: %s:%d\n", pszFile, nLine); } #endif /* DEBUG_LOCKCONTENTION */ @@ -56,20 +56,20 @@ static boost::thread_specific_ptr<LockStack> lockstack; static void potential_deadlock_detected(const std::pair<void*, void*>& mismatch, const LockStack& s1, const LockStack& s2) { - printf("POTENTIAL DEADLOCK DETECTED\n"); - printf("Previous lock order was:\n"); + LogPrintf("POTENTIAL DEADLOCK DETECTED\n"); + LogPrintf("Previous lock order was:\n"); BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, s2) { - if (i.first == mismatch.first) printf(" (1)"); - if (i.first == mismatch.second) printf(" (2)"); - printf(" %s\n", i.second.ToString().c_str()); + if (i.first == mismatch.first) LogPrintf(" (1)"); + if (i.first == mismatch.second) LogPrintf(" (2)"); + LogPrintf(" %s\n", i.second.ToString().c_str()); } - printf("Current lock order is:\n"); + LogPrintf("Current lock order is:\n"); BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, s1) { - if (i.first == mismatch.first) printf(" (1)"); - if (i.first == mismatch.second) printf(" (2)"); - printf(" %s\n", i.second.ToString().c_str()); + if (i.first == mismatch.first) LogPrintf(" (1)"); + if (i.first == mismatch.second) LogPrintf(" (2)"); + LogPrintf(" %s\n", i.second.ToString().c_str()); } } @@ -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) printf("Locking: %s\n", locklocation.ToString().c_str()); + if (fDebug) LogPrintf("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; - printf("Unlocked: %s\n", locklocation.ToString().c_str()); + LogPrintf("Unlocked: %s\n", locklocation.ToString().c_str()); } dd_mutex.lock(); (*lockstack).pop_back(); |