tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

bug1971462.js (518B)


      1 // |jit-test| skip-if: !this.SharedArrayBuffer || helperThreadCount() === 0
      2 
      3 const sab = new SharedArrayBuffer(4);
      4 const i32a = new Int32Array(sab);
      5 setSharedObject(sab);
      6 
      7 evalInWorker(`
      8  const sab = getSharedObject();
      9  const i32a = new Int32Array(sab);
     10 
     11  Atomics.store(i32a, 0, 1);
     12 
     13  const veryLargeMs = 9.223372036854776e12;
     14  print(Atomics.wait(i32a, 0, 1, veryLargeMs));
     15  Atomics.store(i32a, 0, 2);
     16 `);
     17 
     18 while (Atomics.load(i32a, 0) == 0) {}
     19 
     20 while (Atomics.load(i32a, 0) == 1) {
     21  Atomics.notify(i32a, 0);
     22 }