mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 06:25:30 +02:00
Atomics: simplify harness/atomicsHelper.js: waitUntil
This commit is contained in:
parent
64be6186be
commit
be21156542
@ -36,10 +36,10 @@ function getReport() {
|
|||||||
* @param {Number} expected The number of agents that are expected to report as active.
|
* @param {Number} expected The number of agents that are expected to report as active.
|
||||||
*/
|
*/
|
||||||
function waitUntil(i32a, index, expected) {
|
function waitUntil(i32a, index, expected) {
|
||||||
while (Atomics.load(i32a, index) !== expected) {
|
let agents = 0;
|
||||||
|
while ((agents = Atomics.load(i32a, index)) !== expected) {
|
||||||
/* nothing */
|
/* nothing */
|
||||||
}
|
}
|
||||||
const agents = Atomics.load(i32a, index);
|
|
||||||
assert.sameValue(agents, expected, `'agents' equals the value of 'expected' (${expected})`);
|
assert.sameValue(agents, expected, `'agents' equals the value of 'expected' (${expected})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user