mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 10:42:46 +01:00
refactor: Drop owns_lock() call
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
This commit is contained in:
@@ -165,10 +165,11 @@ private:
|
|||||||
bool TryEnter(const char* pszName, const char* pszFile, int nLine)
|
bool TryEnter(const char* pszName, const char* pszFile, int nLine)
|
||||||
{
|
{
|
||||||
EnterCritical(pszName, pszFile, nLine, Base::mutex(), true);
|
EnterCritical(pszName, pszFile, nLine, Base::mutex(), true);
|
||||||
if (!Base::try_lock()) {
|
if (Base::try_lock()) {
|
||||||
LeaveCritical();
|
return true;
|
||||||
}
|
}
|
||||||
return Base::owns_lock();
|
LeaveCritical();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user