| 542 | } |
| 543 | |
| 544 | void fx_Atomics_wait(txMachine* the) |
| 545 | { |
| 546 | mxAtomicsDeclarations(1, 1, 0); |
| 547 | txNumber timeout; |
| 548 | txInteger result; |
| 549 | fxPushAtomicsValue(the, 2, dispatch->value.typedArray.dispatch->constructorID); |
| 550 | timeout = (mxArgc > 3) ? fxToNumber(the, mxArgv(3)) : C_NAN; |
| 551 | if (c_isnan(timeout)) |
| 552 | timeout = C_INFINITY; |
| 553 | else if (timeout < 0) |
| 554 | timeout = 0; |
| 555 | result = (*dispatch->value.typedArray.atomics->wait)(the, host, offset, the->stack, timeout); |
| 556 | if (result < 0) |
| 557 | mxPushStringX("not-equal"); |
| 558 | else { |
| 559 | result = fxWaitSharedChunk(the, (txByte*)host->value.host.data + offset, timeout, C_NULL); |
| 560 | if (result == 0) |
| 561 | mxPushStringX("timed-out"); |
| 562 | else |
| 563 | mxPushStringX("ok"); |
| 564 | } |
| 565 | mxPullSlot(mxResult); |
| 566 | } |
| 567 | |
| 568 | #if mxECMAScript2024 |
| 569 | void fx_Atomics_waitAsync(txMachine* the) |
nothing calls this directly
no test coverage detected