refactor: Drop owns_lock() call

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
This commit is contained in:
Hennadii Stepanov 2022-10-03 12:26:37 +01:00
parent bff4e068b6
commit 30cc1c6609
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

View File

@ -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: