[*] Minor ConditionVariableNT optimization (SteadyClockNS() may syscall under vms)
This commit is contained in:
parent
f2eadb4653
commit
9f5c0e559c
@ -45,18 +45,19 @@ namespace Aurora::Threading::Primitives
|
||||
{
|
||||
#if !defined(AURORA_FORCE_SRW_LOCKS)
|
||||
bool bRet { true };
|
||||
bool bIOU {};
|
||||
|
||||
auto pThatMutex = reinterpret_cast<NT4Mutex *>(&pMutex->lock_);
|
||||
|
||||
this->AddWaiter();
|
||||
|
||||
pMutex->Unlock();
|
||||
|
||||
if (qwTimeout)
|
||||
{
|
||||
auto uEndTimeSteady = gUseNativeWaitCondvar ? AuTime::SteadyClockNS() + qwTimeout : 0;
|
||||
auto uEndTimeWall = AuTime::CurrentClockNS() + qwTimeout;
|
||||
auto uTargetTimeNt = AuTime::ConvertTimestampNs(uEndTimeWall);
|
||||
bool bIOU {};
|
||||
|
||||
this->AddWaiter();
|
||||
|
||||
pMutex->Unlock();
|
||||
|
||||
while (true)
|
||||
{
|
||||
@ -171,12 +172,6 @@ namespace Aurora::Threading::Primitives
|
||||
}
|
||||
else
|
||||
{
|
||||
bool bIOU {};
|
||||
|
||||
this->AddWaiter();
|
||||
|
||||
pMutex->Unlock();
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (gUseNativeWaitCondvar)
|
||||
|
Loading…
Reference in New Issue
Block a user