Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
347 bytes
|
Line | |
---|
1 | // Set the index-th bith in i32array[0], then wait for it to be un-set again.
|
---|
2 | module.exports = function ({ i32array, index }) {
|
---|
3 | Atomics.or(i32array, 0, 1 << index);
|
---|
4 | Atomics.notify(i32array, 0, Infinity);
|
---|
5 | do {
|
---|
6 | const v = Atomics.load(i32array, 0);
|
---|
7 | if (!(v & (1 << index))) break;
|
---|
8 | Atomics.wait(i32array, 0, v);
|
---|
9 | } while (true);
|
---|
10 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.