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

Function LightEvent_Wait

libctru/source/synchronization.c:310–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310void LightEvent_Wait(LightEvent* event)
311{
312 for (;;)
313 {
314 if (event->state == CLEARED_STICKY)
315 {
316 syncArbitrateAddress(&event->state, ARBITRATION_WAIT_IF_LESS_THAN, SIGNALED_ONESHOT);
317 return;
318 }
319 if (event->state != CLEARED_ONESHOT)
320 {
321 if (event->state == SIGNALED_STICKY)
322 return;
323 if (event->state == SIGNALED_ONESHOT && LightEvent_TryReset(event))
324 return;
325 }
326 syncArbitrateAddress(&event->state, ARBITRATION_WAIT_IF_LESS_THAN, SIGNALED_ONESHOT);
327 }
328}
329
330int LightEvent_WaitTimeout(LightEvent* event, s64 timeout_ns)
331{

Callers 4

ndspSyncFunction · 0.85
gspWaitForEventFunction · 0.85
aptReceiveParameterFunction · 0.85
aptHandleSleepFunction · 0.85

Calls 2

syncArbitrateAddressFunction · 0.85
LightEvent_TryResetFunction · 0.85

Tested by

no test coverage detected