[*] Fix bugs in Mutex.NT.cpp
This commit is contained in:
parent
df1c36bd28
commit
fac6571504
@ -62,14 +62,16 @@ namespace Aurora::Threading::Primitives
|
||||
|
||||
if (timeout != 0)
|
||||
{
|
||||
timeoutMs = endTime - static_cast<AuInt64>(Time::CurrentClockMS());
|
||||
if (timeoutMs < 0)
|
||||
startTime = Time::CurrentClockMS();
|
||||
if (startTime >= endTime)
|
||||
{
|
||||
goto exitWin32;
|
||||
}
|
||||
|
||||
timeoutMs = endTime - startTime;
|
||||
}
|
||||
|
||||
status = SleepConditionVariableSRW(&wakeup_, &atomicHolder_, endTime, CONDITION_VARIABLE_LOCKMODE_SHARED);
|
||||
status = SleepConditionVariableSRW(&wakeup_, &atomicHolder_, timeoutMs, CONDITION_VARIABLE_LOCKMODE_SHARED);
|
||||
if (!status)
|
||||
{
|
||||
SysAssertExp(GetLastError() == ERROR_TIMEOUT);
|
||||
@ -77,9 +79,9 @@ namespace Aurora::Threading::Primitives
|
||||
}
|
||||
}
|
||||
|
||||
exitWin32:
|
||||
returnValue = true;
|
||||
|
||||
exitWin32:
|
||||
ReleaseSRWLockShared(&atomicHolder_);
|
||||
return returnValue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user