[*] Fix busted timeout calc in the previous two commits
This commit is contained in:
parent
186444853d
commit
e366d058f6
@ -115,7 +115,7 @@ namespace Aurora::IO::Loop
|
||||
|
||||
bool LSLocalMutex::TryTakeWaitMS(AuUInt32 timeout)
|
||||
{
|
||||
auto uEndTime = AuTime::SteadyClockMS() + timeout;
|
||||
auto uEndTime = AuTime::SteadyClockNS() + AuMSToNS<AuUInt64>(timeout);
|
||||
|
||||
if (this->TryTakeSpin())
|
||||
{
|
||||
@ -139,7 +139,9 @@ namespace Aurora::IO::Loop
|
||||
return false;
|
||||
}
|
||||
|
||||
if (LSSemaphore::WaitOn(AuNSToMS<AuInt64>(uEndTime - uStartTime)))
|
||||
auto uDeltaMs = AuNSToMS<AuInt64>(uEndTime - uStartTime);
|
||||
if (uDeltaMs &&
|
||||
LSSemaphore::WaitOn(uDeltaMs))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ namespace Aurora::IO::Loop
|
||||
|
||||
bool LSLocalSemaphore::TryTakeWaitMS(AuUInt32 timeout)
|
||||
{
|
||||
auto uEndTime = AuTime::SteadyClockMS() + timeout;
|
||||
auto uEndTime = AuTime::SteadyClockNS() + AuMSToNS<AuUInt64>(timeout);
|
||||
|
||||
if (this->TryTakeSpin())
|
||||
{
|
||||
@ -142,7 +142,9 @@ namespace Aurora::IO::Loop
|
||||
return false;
|
||||
}
|
||||
|
||||
if (LSSemaphore::WaitOn(AuNSToMS<AuInt64>(uEndTime - uStartTime)))
|
||||
auto uDeltaMs = AuNSToMS<AuInt64>(uEndTime - uStartTime);
|
||||
if (uDeltaMs &&
|
||||
LSSemaphore::WaitOn(uDeltaMs))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user