| 198 | } |
| 199 | |
| 200 | int 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 | |
| 216 | void CondVar_WakeUp(CondVar* cv, s32 num_threads) |
| 217 | { |
no test coverage detected