[+] AuThreading::TryWait
This commit is contained in:
parent
8e54071d60
commit
bf03124f92
@ -14,6 +14,7 @@ namespace Aurora::Threading
|
||||
AUKN_SYM bool YieldPollNs(bool bPermitMultipleContextSwitches, AuUInt64 qwAbsTimeoutNs, PollCallback_cb cb);
|
||||
|
||||
AUKN_SYM bool WaitForAbsNS(IWaitable *pWaitable, AuUInt64 qwAbsTimeout = 0);
|
||||
AUKN_SYM bool TryWait(IWaitable *pWaitable);
|
||||
|
||||
static const auto kWaitForFlagTimeoutIsNanoseconds = 1ul;
|
||||
static const auto kWaitForFlagTimeoutIsAbsolute = 1ul << 1;
|
||||
|
@ -88,7 +88,20 @@ namespace Aurora::Threading
|
||||
return pWaitable->TryLock();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
AUKN_SYM bool TryWait(IWaitable *pWaitable)
|
||||
{
|
||||
if (pWaitable->HasLockImplementation())
|
||||
{
|
||||
return pWaitable->TryLock();
|
||||
}
|
||||
|
||||
return Primitives::DoTryIf([=]()
|
||||
{
|
||||
return pWaitable->TryLock();
|
||||
});
|
||||
}
|
||||
|
||||
AUKN_SYM bool WaitFor(const AuList<IWaitable *> &waitables, AuUInt32 uFlags, AuUInt64 uTimeout)
|
||||
{
|
||||
AU_DEBUG_MEMCRUNCH;
|
||||
|
Loading…
Reference in New Issue
Block a user