diff --git a/src/sync.cpp b/src/sync.cpp index eace86d9dda..98e6d3d65d8 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -24,11 +23,6 @@ #include #include -void LockContention(const char* pszName, const char* pszFile, int nLine) -{ - LOG_TIME_MICROS_WITH_CATEGORY(strprintf("%s, %s:%d", pszName, pszFile, nLine), BCLog::LOCK); -} - #ifdef DEBUG_LOCKORDER // // Early deadlock detection. diff --git a/src/sync.h b/src/sync.h index bf15c0b4eb4..6ba63d5e4de 100644 --- a/src/sync.h +++ b/src/sync.h @@ -6,6 +6,8 @@ #ifndef BITCOIN_SYNC_H #define BITCOIN_SYNC_H +#include +#include #include #include @@ -126,9 +128,6 @@ using RecursiveMutex = AnnotatedMixin; /** Wrapped mutex: supports waiting but not recursive locking */ typedef AnnotatedMixin Mutex; -/** Prints a lock contention to the log */ -void LockContention(const char* pszName, const char* pszFile, int nLine); - /** Wrapper around std::unique_lock style lock for Mutex. */ template class SCOPED_LOCKABLE UniqueLock : public Base @@ -138,7 +137,7 @@ private: { EnterCritical(pszName, pszFile, nLine, Base::mutex()); if (Base::try_lock()) return; - LockContention(pszName, pszFile, nLine); // log the contention + LOG_TIME_MICROS_WITH_CATEGORY(strprintf("lock contention %s, %s:%d", pszName, pszFile, nLine), BCLog::LOCK); Base::lock(); }