From a9cfbd1048f79796d4835cb88412ebcdc19d8a5c Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Sun, 17 Nov 2024 16:04:28 +0000 Subject: [PATCH] fix: don't use non-existent `PrintLockContention` in `SharedEnter` `PrintLockContention` hasn't existed since dash#6046 --- src/sync.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/sync.h b/src/sync.h index dfe5846d7c..6f4ffcc680 100644 --- a/src/sync.h +++ b/src/sync.h @@ -256,13 +256,10 @@ private: { EnterCritical(pszName, pszFile, nLine, Base::mutex()); #ifdef DEBUG_LOCKCONTENTION - if (!Base::try_lock()) { - PrintLockContention(pszName, pszFile, nLine); -#endif - Base::lock(); -#ifdef DEBUG_LOCKCONTENTION - } + if (Base::try_lock()) return; + LOG_TIME_MICROS_WITH_CATEGORY(strprintf("lock contention %s, %s:%d", pszName, pszFile, nLine), BCLog::LOCK); #endif + Base::lock(); } bool TrySharedEnter(const char* pszName, const char* pszFile, int nLine)