MCPcopy Create free account
hub / github.com/devkitPro/libctru / CondVar_WaitTimeout

Function CondVar_WaitTimeout

libctru/source/synchronization.c:200–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200int CondVar_WaitTimeout(CondVar* cv, LightLock* lock, s64 timeout_ns)
201{
202 CondVar_BeginWait(cv, lock);
203
204 bool timedOut = false;
205 Result rc = syncArbitrateAddressWithTimeout(cv, ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT, 0, timeout_ns);
206 if (R_DESCRIPTION(rc) == RD_TIMEOUT)
207 {
208 timedOut = CondVar_EndWait(cv, 1);
209 __dmb();
210 }
211
212 LightLock_Lock(lock);
213 return timedOut;
214}
215
216void CondVar_WakeUp(CondVar* cv, s32 num_threads)
217{

Callers 2

__SYSCALL(cond_wait)Function · 0.85

Calls 5

CondVar_BeginWaitFunction · 0.85
CondVar_EndWaitFunction · 0.85
__dmbFunction · 0.85
LightLock_LockFunction · 0.85

Tested by

no test coverage detected