Skip to content
Snippets Groups Projects
Commit d8bbc281 authored by Leo Balter's avatar Leo Balter Committed by Rick Waldron
Browse files

First renaming for wake to notify in the wait folder

parent 4911c6e7
No related branches found
No related tags found
No related merge requests found
Showing
with 45 additions and 40 deletions
...@@ -39,5 +39,5 @@ $262.agent.waitUntil(i64a, RUNNING, 1n); ...@@ -39,5 +39,5 @@ $262.agent.waitUntil(i64a, RUNNING, 1n);
// Try to yield control to ensure the agent actually started to wait. // Try to yield control to ensure the agent actually started to wait.
$262.agent.tryYield(); $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"'); assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
...@@ -36,4 +36,4 @@ assert.sameValue( ...@@ -36,4 +36,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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( ...@@ -56,4 +56,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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 @@ ...@@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > 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] includes: [atomicsHelper.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/ ---*/
...@@ -49,6 +49,6 @@ assert.sameValue( ...@@ -49,6 +49,6 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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 @@ ...@@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > 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] includes: [atomicsHelper.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/ ---*/
...@@ -49,6 +49,6 @@ assert.sameValue( ...@@ -49,6 +49,6 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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 @@ ...@@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > 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] includes: [atomicsHelper.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/ ---*/
...@@ -49,4 +49,4 @@ assert.sameValue( ...@@ -49,4 +49,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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 @@ ...@@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > 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] includes: [atomicsHelper.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/ ---*/
...@@ -49,4 +49,9 @@ assert.sameValue( ...@@ -49,4 +49,9 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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.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 @@ ...@@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > 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] includes: [atomicsHelper.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/ ---*/
...@@ -49,4 +49,4 @@ assert.sameValue( ...@@ -49,4 +49,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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( ...@@ -49,4 +49,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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 @@ ...@@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > 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] includes: [atomicsHelper.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/ ---*/
...@@ -49,4 +49,4 @@ assert.sameValue( ...@@ -49,4 +49,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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 @@ ...@@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > 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] includes: [atomicsHelper.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/ ---*/
...@@ -49,4 +49,4 @@ assert.sameValue( ...@@ -49,4 +49,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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); ...@@ -56,20 +56,20 @@ $262.agent.broadcast(i64a.buffer);
// Wait until all agents started. // Wait until all agents started.
$262.agent.waitUntil(i64a, RUNNING, BigInt(NUMAGENT)); $262.agent.waitUntil(i64a, RUNNING, BigInt(NUMAGENT));
// Wake index 1, wakes nothing // Notify index 1, notifies nothing
assert.sameValue(Atomics.wake(i64a, 1), 0, 'Atomics.wake(i64a, 1) returns 0'); assert.sameValue(Atomics.notify(i64a, 1), 0, 'Atomics.notify(i64a, 1) returns 0');
// Wake index 3, wakes nothing // Notify index 3, notifies nothing
assert.sameValue(Atomics.wake(i64a, 3), 0, 'Atomics.wake(i64a, 3) returns 0'); 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; var woken = 0;
while ((woken = Atomics.wake(i64a, 2)) === 0) ; while ((woken = Atomics.notify(i64a, 2)) === 0) ;
assert.sameValue(woken, 1, 'Atomics.wake(i64a, 2) returns 1'); assert.sameValue(woken, 1, 'Atomics.notify(i64a, 2) returns 1');
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"'); assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
// Wake index 0, wakes 1 // Notify index 0, notifies 1
var woken = 0; var woken = 0;
while ((woken = Atomics.wake(i64a, 0)) === 0) ; while ((woken = Atomics.notify(i64a, 0)) === 0) ;
assert.sameValue(woken, 1, 'Atomics.wake(i64a, 0) returns 1'); assert.sameValue(woken, 1, 'Atomics.notify(i64a, 0) returns 1');
assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"'); assert.sameValue($262.agent.getReport(), 'ok', '$262.agent.getReport() returns "ok"');
...@@ -77,13 +77,13 @@ for (var i = 0; i < NUMAGENT; i++) { ...@@ -77,13 +77,13 @@ for (var i = 0; i < NUMAGENT; i++) {
Atomics.store(i64a, LOCK_INDEX, 0n); 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++) { for (var i = 0; i < NUMAGENT; i++) {
var woken = 0; 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, 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', assert.sameValue($262.agent.getReport(), 'ok',
'$262.agent.getReport() returns "ok", at index = ' + i); '$262.agent.getReport() returns "ok", at index = ' + i);
......
...@@ -50,7 +50,7 @@ $262.agent.waitUntil(i64a, RUNNING, 1n); ...@@ -50,7 +50,7 @@ $262.agent.waitUntil(i64a, RUNNING, 1n);
// Try to yield control to ensure the agent actually started to wait. // Try to yield control to ensure the agent actually started to wait.
$262.agent.tryYield(); $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(); const lapse = $262.agent.getReport();
......
...@@ -81,4 +81,4 @@ assert(lapse >= 0, 'The result of `(lapse >= 0)` is true (timeout should be a mi ...@@ -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(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); ...@@ -39,5 +39,5 @@ $262.agent.waitUntil(i32a, RUNNING, 1);
// Try to yield control to ensure the agent actually started to wait. // Try to yield control to ensure the agent actually started to wait.
$262.agent.tryYield(); $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"'); assert.sameValue($262.agent.getReport(), "ok", '$262.agent.getReport() returns "ok"');
...@@ -36,4 +36,4 @@ assert.sameValue( ...@@ -36,4 +36,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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 @@ ...@@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > 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] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
...@@ -49,4 +49,4 @@ assert.sameValue( ...@@ -49,4 +49,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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 @@ ...@@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > 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] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
...@@ -49,4 +49,4 @@ assert.sameValue( ...@@ -49,4 +49,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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 @@ ...@@ -4,7 +4,7 @@
/*--- /*---
esid: sec-atomics.wait esid: sec-atomics.wait
description: > 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] includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray] features: [Atomics, SharedArrayBuffer, TypedArray]
---*/ ---*/
...@@ -49,4 +49,4 @@ assert.sameValue( ...@@ -49,4 +49,4 @@ assert.sameValue(
'timed-out', 'timed-out',
'$262.agent.getReport() returns "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');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment