Atomics: simplify harness/atomicsHelper.js: waitUntil

This commit is contained in:
Rick Waldron 2018-06-27 10:30:46 -04:00
parent 64be6186be
commit be21156542
1 changed files with 2 additions and 2 deletions

View File

@ -36,10 +36,10 @@ function getReport() {
* @param {Number} expected The number of agents that are expected to report as active.
*/
function waitUntil(i32a, index, expected) {
while (Atomics.load(i32a, index) !== expected) {
let agents = 0;
while ((agents = Atomics.load(i32a, index)) !== expected) {
/* nothing */
}
const agents = Atomics.load(i32a, index);
assert.sameValue(agents, expected, `'agents' equals the value of 'expected' (${expected})`);
}