test/mjsunit/harmony/futex.js
//   always 0. Each worker is waiting on this index.
always 0. Each worker is waiting on this index.
always 0 . Each worker is waiting on this index .
function workerCode() {
      onmessage = function(msg) {
        var id = msg.id;
        var i32a = new Int32Array(msg.sab);
        var result = Atomics.wait(i32a, 4, 0);
        Atomics.store(i32a, id, 1);
        postMessage(result);
      };
    }
function workerCode ( ) { onmessage = function ( msg ) { var id = msg . id ; var i32a = new Int32Array ( msg . sab ) ; var result = Atomics . wait ( i32a , 4 , 0 ) ; Atomics . store ( i32a , id , 1 ) ; postMessage ( result ) ; } ; }
always 0.
always 0 .
// Wait on i32a[4] (should be zero). // Set i32a[id] to 1 to notify the main thread which workers were // woken up.