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