summaryrefslogtreecommitdiffstats
path: root/js/src/tests
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-06-12 03:36:54 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-06-12 03:38:40 +0200
commit284b4cffd7a7ccc311b64744d46b29e219eb132a (patch)
tree3cecbed282fa484fa17ede00e32df0f24bb80e2a /js/src/tests
parent19c0f5e9ff625c6a67e5e0a08f0a800782168492 (diff)
downloadUXP-284b4cffd7a7ccc311b64744d46b29e219eb132a.tar
UXP-284b4cffd7a7ccc311b64744d46b29e219eb132a.tar.gz
UXP-284b4cffd7a7ccc311b64744d46b29e219eb132a.tar.lz
UXP-284b4cffd7a7ccc311b64744d46b29e219eb132a.tar.xz
UXP-284b4cffd7a7ccc311b64744d46b29e219eb132a.zip
Add Atomics.notify instead of Atomics.wake according to revised spec.
- Keep .wake as an alias until we're certain it can be removed. - Enable SAB memory
Diffstat (limited to 'js/src/tests')
-rw-r--r--js/src/tests/shell/futex.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/src/tests/shell/futex.js b/js/src/tests/shell/futex.js
index b0951f12e..8ba61d71c 100644
--- a/js/src/tests/shell/futex.js
+++ b/js/src/tests/shell/futex.js
@@ -67,6 +67,8 @@ if (helperThreadCount() === 0) {
quit();
}
+var mem = new Int32Array(new SharedArrayBuffer(1024));
+
////////////////////////////////////////////////////////////
// wait() returns "not-equal" if the value is not the expected one.
@@ -102,7 +104,7 @@ dprint("Sleeping for 2 seconds");
sleep(2);
dprint("Waking the main thread now");
setSharedArrayBuffer(null);
-assertEq(Atomics.wake(mem, 0, 1), 1); // Can fail spuriously but very unlikely
+assertEq(Atomics.notify(mem, 0, 1), 1); // Can fail spuriously but very unlikely
`);
var then = Date.now();
@@ -113,14 +115,14 @@ assertEq(getSharedArrayBuffer(), null); // The worker's clearing of the mbx is v
////////////////////////////////////////////////////////////
-// Test the default argument to atomics.wake()
+// Test the default argument to atomics.notify()
setSharedArrayBuffer(mem.buffer);
evalInWorker(`
var mem = new Int32Array(getSharedArrayBuffer());
sleep(2); // Probably long enough to avoid a spurious error next
-assertEq(Atomics.wake(mem, 0), 1); // Last argument to wake should default to +Infinity
+assertEq(Atomics.notify(mem, 0), 1); // Last argument to wake should default to +Infinity
`);
var then = Date.now();