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