mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
First renaming for wake to notify in the wait folder
This commit is contained in:
parent
4911c6e77a
commit
d8bbc281dd
test/built-ins/Atomics/wait
bigint
nan-for-timeout.jsnegative-timeout-agent.jsno-spurious-wakeup-no-operation.jsno-spurious-wakeup-on-add.jsno-spurious-wakeup-on-and.jsno-spurious-wakeup-on-compareExchange.jsno-spurious-wakeup-on-exchange.jsno-spurious-wakeup-on-or.jsno-spurious-wakeup-on-store.jsno-spurious-wakeup-on-sub.jsno-spurious-wakeup-on-xor.jswaiterlist-block-indexedposition-wake.jswaiterlist-order-of-operations-is-fifo.jswas-woken-before-timeout.js
false-for-timeout-agent.jsnan-for-timeout.jsnegative-timeout-agent.jsno-spurious-wakeup-on-add.jsno-spurious-wakeup-on-and.jsno-spurious-wakeup-on-compareExchange.jsno-spurious-wakeup-on-exchange.jsno-spurious-wakeup-on-or.jsno-spurious-wakeup-on-store.jsno-spurious-wakeup-on-sub.jsno-spurious-wakeup-on-xor.jsnull-for-timeout-agent.jsobject-for-timeout-agent.jspoisoned-object-for-timeout-throws-agent.jssymbol-for-index-throws-agent.jssymbol-for-timeout-throws-agent.jssymbol-for-value-throws-agent.jstrue-for-timeout-agent.jsundefined-for-timeout.jsundefined-index-defaults-to-zero.jswait-index-value-not-equal.jswaiterlist-block-indexedposition-wake.jswaiterlist-order-of-operations-is-fifo.jswas-woken-before-timeout.js@ -39,5 +39,5 @@ $262.agent.waitUntil(i64a, RUNNING, 1n);
|
||||
// Try to yield control to ensure the agent actually started to wait.
|
||||
$262.agent.tryYield();
|
||||
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 1, 'Atomics.wake(i64a, 0) returns 1');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 1, 'Atomics.notify(i64a, 0) returns 1');
|
||||
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
|
||||
|
@ -36,4 +36,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 0, 'Atomics.wake(i64a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
@ -56,4 +56,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 0, 'Atomics.wake(i64a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to Add operation
|
||||
Waiter does not spuriously notify on index which is subject to Add operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,6 +49,6 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 0, 'Atomics.wake(i64a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to And operation
|
||||
Waiter does not spuriously nofity on index which is subject to And operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,6 +49,6 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 0, 'Atomics.wake(i64a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to compareExchange operation
|
||||
Waiter does not spuriously notify on index which is subject to compareExchange operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 0, 'Atomics.wake(i64a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to exchange operation
|
||||
Waiter does not spuriously notify on index which is subject to exchange operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,9 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
<<<<<<< HEAD
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 0, 'Atomics.wake(i64a, 0) returns 0');
|
||||
=======
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
||||
>>>>>>> e6e13b293e... First renaming for wake to notify in the wait folder
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to Or operation
|
||||
Waiter does not spuriously notify on index which is subject to Or operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 0, 'Atomics.wake(i64a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 0, 'Atomics.wake(i64a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to Sub operation
|
||||
Waiter does not spuriously notify on index which is subject to Sub operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 0, 'Atomics.wake(i64a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to xor operation
|
||||
Waiter does not spuriously notify on index which is subject to xor operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 0, 'Atomics.wake(i64a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
@ -56,20 +56,20 @@ $262.agent.broadcast(i64a.buffer);
|
||||
// Wait until all agents started.
|
||||
$262.agent.waitUntil(i64a, RUNNING, BigInt(NUMAGENT));
|
||||
|
||||
// Wake index 1, wakes nothing
|
||||
assert.sameValue(Atomics.wake(i64a, 1), 0, 'Atomics.wake(i64a, 1) returns 0');
|
||||
// Notify index 1, notifies nothing
|
||||
assert.sameValue(Atomics.notify(i64a, 1), 0, 'Atomics.notify(i64a, 1) returns 0');
|
||||
|
||||
// Wake index 3, wakes nothing
|
||||
assert.sameValue(Atomics.wake(i64a, 3), 0, 'Atomics.wake(i64a, 3) returns 0');
|
||||
// Notify index 3, notifies nothing
|
||||
assert.sameValue(Atomics.notify(i64a, 3), 0, 'Atomics.notify(i64a, 3) returns 0');
|
||||
|
||||
// Wake index 2, wakes 1
|
||||
// Notify index 2, notifies 1
|
||||
var woken = 0;
|
||||
while ((woken = Atomics.wake(i64a, 2)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.wake(i64a, 2) returns 1');
|
||||
while ((woken = Atomics.notify(i64a, 2)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.notify(i64a, 2) returns 1');
|
||||
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
|
||||
|
||||
// Wake index 0, wakes 1
|
||||
// Notify index 0, notifies 1
|
||||
var woken = 0;
|
||||
while ((woken = Atomics.wake(i64a, 0)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.wake(i64a, 0) returns 1');
|
||||
while ((woken = Atomics.notify(i64a, 0)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.notify(i64a, 0) returns 1');
|
||||
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
|
||||
|
@ -77,13 +77,13 @@ for (var i = 0; i < NUMAGENT; i++) {
|
||||
Atomics.store(i64a, LOCK_INDEX, 0n);
|
||||
}
|
||||
|
||||
// Agents must wake in the order they waited.
|
||||
// Agents must notify in the order they waited.
|
||||
for (var i = 0; i < NUMAGENT; i++) {
|
||||
var woken = 0;
|
||||
while ((woken = Atomics.wake(i64a, WAIT_INDEX, 1)) === 0) ;
|
||||
while ((woken = Atomics.notify(i64a, WAIT_INDEX, 1)) === 0) ;
|
||||
|
||||
assert.sameValue(woken, 1,
|
||||
'Atomics.wake(i64a, WAIT_INDEX, 1) returns 1, at index = ' + i);
|
||||
'Atomics.notify(i64a, WAIT_INDEX, 1) returns 1, at index = ' + i);
|
||||
|
||||
assert.sameValue($262.agent.getReport(), 'ok',
|
||||
'$262.agent.getReport() returns "ok", at index = ' + i);
|
||||
|
@ -50,7 +50,7 @@ $262.agent.waitUntil(i64a, RUNNING, 1n);
|
||||
// Try to yield control to ensure the agent actually started to wait.
|
||||
$262.agent.tryYield();
|
||||
|
||||
assert.sameValue(Atomics.wake(i64a, 0), 1, 'Atomics.wake(i64a, 0) returns 1');
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 1, 'Atomics.notify(i64a, 0) returns 1');
|
||||
|
||||
const lapse = $262.agent.getReport();
|
||||
|
||||
|
@ -81,4 +81,4 @@ assert(lapse >= 0, 'The result of `(lapse >= 0)` is true (timeout should be a mi
|
||||
|
||||
assert(lapse <= $262.agent.MAX_TIME_EPSILON, 'The result of `(lapse <= $262.agent.MAX_TIME_EPSILON)` is true');
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -39,5 +39,5 @@ $262.agent.waitUntil(i32a, RUNNING, 1);
|
||||
// Try to yield control to ensure the agent actually started to wait.
|
||||
$262.agent.tryYield();
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 1, 'Atomics.wake(i32a, 0) returns 1');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 1, 'Atomics.notify(i32a, 0) returns 1');
|
||||
assert.sameValue($262.agent.getReport(), "ok", '$262.agent.getReport() returns "ok"');
|
||||
|
@ -36,4 +36,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to Add operation
|
||||
Waiter does not spuriously notify on index which is subject to Add operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to And operation
|
||||
Waiter does not spuriously notify on index which is subject to And operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to compareExchange operation
|
||||
Waiter does not spuriously notify on index which is subject to compareExchange operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to exchange operation
|
||||
Waiter does not spuriously notify on index which is subject to exchange operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to Or operation
|
||||
Waiter does not spuriously notify on index which is subject to Or operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to Store operation
|
||||
Waiter does not spuriously notify on index which is subject to Store operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to Sub operation
|
||||
Waiter does not spuriously notify on index which is subject to Sub operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*---
|
||||
esid: sec-atomics.wait
|
||||
description: >
|
||||
Waiter does not spuriously wake on index which is subject to xor operation
|
||||
Waiter does not spuriously notify on index which is subject to xor operation
|
||||
includes: [atomicsHelper.js]
|
||||
features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
---*/
|
||||
@ -49,4 +49,4 @@ assert.sameValue(
|
||||
'timed-out',
|
||||
'$262.agent.getReport() returns "timed-out"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -81,4 +81,4 @@ assert(lapse >= 0, 'The result of `(lapse >= 0)` is true (timeout should be a mi
|
||||
|
||||
assert(lapse <= $262.agent.MAX_TIME_EPSILON, 'The result of `(lapse <= $262.agent.MAX_TIME_EPSILON)` is true (timeout should be a max of $262.agent.MAX_TIME_EPSILON)');
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -87,4 +87,4 @@ assert(lapse >= 0, 'The result of `(lapse >= 0)` is true (timeout should be a mi
|
||||
|
||||
assert(lapse <= $262.agent.MAX_TIME_EPSILON, 'The result of `(lapse <= $262.agent.MAX_TIME_EPSILON)` is true (timeout should be a max of $$262.agent.MAX_TIME_EPSILON)');
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -85,4 +85,4 @@ assert(lapse >= 0, 'The result of `(lapse >= 0)` is true (timeout should be a mi
|
||||
|
||||
assert(lapse <= $262.agent.MAX_TIME_EPSILON, 'The result of `(lapse <= $262.agent.MAX_TIME_EPSILON)` is true (timeout should be a max of $$262.agent.MAX_TIME_EPSILON)');
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -97,4 +97,4 @@ const lapse = $262.agent.getReport();
|
||||
assert(lapse >= 0, 'The result of `(lapse >= 0)` is true (The result of `(lapse >= 0)` is true (timeout should be a min of 0ms))');
|
||||
assert(lapse <= $262.agent.MAX_TIME_EPSILON, 'The result of `(lapse <= $262.agent.MAX_TIME_EPSILON)` is true (The result of `(lapse <= $262.agent.MAX_TIME_EPSILON)` is true (timeout should be a max of $$262.agent.MAX_TIME_EPSILON))');
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -72,4 +72,4 @@ const lapse = $262.agent.getReport();
|
||||
assert(lapse >= 0, 'The result of `(lapse >= 0)` is true (timeout should be a min of 0ms)');
|
||||
assert(lapse <= $262.agent.MAX_TIME_EPSILON, 'The result of `(lapse <= $262.agent.MAX_TIME_EPSILON)` is true (timeout should be a max of $$262.agent.MAX_TIME_EPSILON)');
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -88,4 +88,4 @@ const lapse = $262.agent.getReport();
|
||||
assert(lapse >= 0, 'The result of `(lapse >= 0)` is true (timeout should be a min of 0ms)');
|
||||
assert(lapse <= $262.agent.MAX_TIME_EPSILON, 'The result of `(lapse <= $262.agent.MAX_TIME_EPSILON)` is true (timeout should be a max of $$262.agent.MAX_TIME_EPSILON)');
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -81,4 +81,4 @@ assert(lapse >= 0, 'The result of `(lapse >= 0)` is true (timeout should be a mi
|
||||
|
||||
assert(lapse <= $262.agent.MAX_TIME_EPSILON, 'The result of `(lapse <= $262.agent.MAX_TIME_EPSILON)` is true (timeout should be a max of $$262.agent.MAX_TIME_EPSILON)');
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -20,7 +20,7 @@ features: [Atomics, SharedArrayBuffer, TypedArray]
|
||||
const WAIT_INDEX = 0; // Index all agents are waiting on
|
||||
const RUNNING = 1;
|
||||
const NUMAGENT = 2; // Total number of agents started
|
||||
const WAKECOUNT = 2; // Total number of agents to wake up
|
||||
const WAKECOUNT = 2; // Total number of agents to notify up
|
||||
|
||||
$262.agent.start(`
|
||||
$262.agent.receiveBroadcast(function(sab) {
|
||||
@ -55,9 +55,9 @@ $262.agent.waitUntil(i32a, RUNNING, NUMAGENT);
|
||||
$262.agent.tryYield();
|
||||
|
||||
assert.sameValue(
|
||||
Atomics.wake(i32a, WAIT_INDEX, WAKECOUNT),
|
||||
Atomics.notify(i32a, WAIT_INDEX, WAKECOUNT),
|
||||
WAKECOUNT,
|
||||
'Atomics.wake(i32a, WAIT_INDEX, WAKECOUNT) returns the value of `WAKECOUNT` (2)'
|
||||
'Atomics.notify(i32a, WAIT_INDEX, WAKECOUNT) returns the value of `WAKECOUNT` (2)'
|
||||
);
|
||||
|
||||
const reports = [];
|
||||
|
@ -45,6 +45,6 @@ $262.agent.waitUntil(i32a, RUNNING, 1);
|
||||
// Try to yield control to ensure the agent actually started to wait.
|
||||
$262.agent.tryYield();
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 1, 'Atomics.wake(i32a, 0) returns 1'); // wake at index 0
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0'); // wake again at index 0, and 0 agents should be woken
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 1, 'Atomics.notify(i32a, 0) returns 1'); // notify at index 0
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0'); // notify again at index 0, and 0 agents should be woken
|
||||
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
|
||||
|
@ -54,4 +54,4 @@ assert.sameValue(
|
||||
'not-equal',
|
||||
'$262.agent.getReport() returns "not-equal"'
|
||||
);
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 0, 'Atomics.wake(i32a, 0) returns 0');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
@ -56,20 +56,20 @@ $262.agent.broadcast(i32a.buffer);
|
||||
// Wait until all agents started.
|
||||
$262.agent.waitUntil(i32a, RUNNING, NUMAGENT);
|
||||
|
||||
// Wake index 1, wakes nothing
|
||||
assert.sameValue(Atomics.wake(i32a, 1), 0, 'Atomics.wake(i32a, 1) returns 0');
|
||||
// Wake index 1, notifies nothing
|
||||
assert.sameValue(Atomics.notify(i32a, 1), 0, 'Atomics.notify(i32a, 1) returns 0');
|
||||
|
||||
// Wake index 3, wakes nothing
|
||||
assert.sameValue(Atomics.wake(i32a, 3), 0, 'Atomics.wake(i32a, 3) returns 0');
|
||||
// Wake index 3, notifies nothing
|
||||
assert.sameValue(Atomics.notify(i32a, 3), 0, 'Atomics.notify(i32a, 3) returns 0');
|
||||
|
||||
// Wake index 2, wakes 1
|
||||
// Wake index 2, notifies 1
|
||||
var woken = 0;
|
||||
while ((woken = Atomics.wake(i32a, 2)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.wake(i32a, 2) returns 1');
|
||||
while ((woken = Atomics.notify(i32a, 2)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.notify(i32a, 2) returns 1');
|
||||
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
|
||||
|
||||
// Wake index 0, wakes 1
|
||||
// Wake index 0, notifies 1
|
||||
var woken = 0;
|
||||
while ((woken = Atomics.wake(i32a, 0)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.wake(i32a, 0) returns 1');
|
||||
while ((woken = Atomics.notify(i32a, 0)) === 0) ;
|
||||
assert.sameValue(woken, 1, 'Atomics.notify(i32a, 0) returns 1');
|
||||
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
|
||||
|
@ -77,13 +77,13 @@ for (var i = 0; i < NUMAGENT; i++) {
|
||||
Atomics.store(i32a, LOCK_INDEX, 0);
|
||||
}
|
||||
|
||||
// Agents must wake in the order they waited.
|
||||
// Agents must notify in the order they waited.
|
||||
for (var i = 0; i < NUMAGENT; i++) {
|
||||
var woken = 0;
|
||||
while ((woken = Atomics.wake(i32a, WAIT_INDEX, 1)) === 0) ;
|
||||
while ((woken = Atomics.notify(i32a, WAIT_INDEX, 1)) === 0) ;
|
||||
|
||||
assert.sameValue(woken, 1,
|
||||
'Atomics.wake(i32a, WAIT_INDEX, 1) returns 1, at index = ' + i);
|
||||
'Atomics.notify(i32a, WAIT_INDEX, 1) returns 1, at index = ' + i);
|
||||
|
||||
assert.sameValue($262.agent.getReport(), 'ok',
|
||||
'$262.agent.getReport() returns "ok", at index = ' + i);
|
||||
|
@ -50,7 +50,7 @@ $262.agent.waitUntil(i32a, RUNNING, 1);
|
||||
// Try to yield control to ensure the agent actually started to wait.
|
||||
$262.agent.tryYield();
|
||||
|
||||
assert.sameValue(Atomics.wake(i32a, 0), 1, 'Atomics.wake(i32a, 0) returns 1');
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 1, 'Atomics.notify(i32a, 0) returns 1');
|
||||
|
||||
const lapse = $262.agent.getReport();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user