mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 13:47:10 +01:00
Simplified the timed try lock implementation.
This commit is contained in:
@@ -128,19 +128,8 @@ bool FastMutexImpl::tryLockImpl(long milliseconds)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TryEnterCriticalSection(&_cs) == TRUE)
|
||||
{
|
||||
if (_lockCount == 0)
|
||||
{
|
||||
++_lockCount;
|
||||
return true;
|
||||
}
|
||||
|
||||
// We're trying to go recursive
|
||||
LeaveCriticalSection(&_cs);
|
||||
Sleep(milliseconds);
|
||||
return false;
|
||||
}
|
||||
if (tryLockImpl())
|
||||
return true;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user