mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-06 13:41:31 +01:00
Simplified the timed try lock implementation.
This commit is contained in:
parent
2a90e7de92
commit
120fd4433c
@ -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 (...)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user