| 308 | } |
| 309 | |
| 310 | void 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 | |
| 330 | int LightEvent_WaitTimeout(LightEvent* event, s64 timeout_ns) |
| 331 | { |
no test coverage detected