From 8793bf5d57ab1c75211d11ad3469300d48205301 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Tue, 20 Nov 2018 15:18:14 -0500 Subject: [PATCH] Atomics: fix running index in notify-with-no-matching-agents-waiting.js Migrating all tests to this API is necessary to prevent tests from hanging indefinitely when a SAB is sent to a worker but the code in the worker attempts to create a non-sharable TypedArray (something that is not Int32Array or BigInt64Array). When that scenario occurs, an exception is thrown and the agent worker can no longer communicate with any other threads that control the SAB. If the main thread happens to be spinning in the $262.agent.waitUntil() while loop, it will never meet its termination condition and the test will hang indefinitely. Because we've defined $262.agent.broadcast(SAB) in https://github.com/tc39/test262/blob/master/INTERPRETING.md, there are host implementations that assume compatibility, which must be maintained. --- .../Atomics/notify/notify-with-no-matching-agents-waiting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js b/test/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js index 3eade75b90..5fc8267c42 100644 --- a/test/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js +++ b/test/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js @@ -10,7 +10,7 @@ includes: [atomicsHelper.js] features: [Atomics, SharedArrayBuffer, TypedArray] ---*/ -const RUNNING = 1; +const RUNNING = 0; $262.agent.start(` $262.agent.receiveBroadcast(function(sab) {