MCPcopy Create free account
hub / github.com/nodejs/node / jsWakeCheck

Function jsWakeCheck

deps/v8/test/mjsunit/wasm/atomics-memory64.js:217–233  ·  view source on GitHub ↗
(index, num, workers, msg)

Source from the content-addressed store, hash-verified

215 }
216
217 let jsWakeCheck = function(index, num, workers, msg) {
218 waitForAllWorkers(index);
219 let indexJs = index / 4;
220 if (num >= numWorkers) {
221 // If numWorkers or more is passed to wake, numWorkers workers should be
222 // woken.
223 assertEquals(numWorkers, Atomics.notify(i32a, indexJs, num));
224 } else {
225 // If num < numWorkers is passed to wake, num workers should be woken.
226 // Then the remaining workers are woken for the next part.
227 assertEquals(num, Atomics.notify(i32a, indexJs, num));
228 assertEquals(numWorkers-num, Atomics.notify(i32a, indexJs, numWorkers));
229 }
230 for (let id = 0; id < numWorkers; id++) {
231 assertEquals(msg, workers[id].getMessage());
232 }
233 };
234
235 let wasmWakeCheck = function(offset, index, num, workers, msg) {
236 waitForAllWorkers(offset + index);

Callers 1

TestWasmAtomicsInWorkersFunction · 0.70

Calls 2

waitForAllWorkersFunction · 0.70
assertEqualsFunction · 0.50

Tested by

no test coverage detected