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 37 additions and 37 deletions
......@@ -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();
......
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