refactor: Drop owns_lock() call
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
This commit is contained in:
1 parent
bff4e068b6
commit
30cc1c6609
1 file changed
+4
-3
+4
-3
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user