blob: 056ba95fac4e3de5a05e2d2976379d889964059e [file] [log] [blame]
importScripts("worker-resources.js");
onmessage = function(event) {
var memory = event.data;
var didStartIdx = 0;
var shouldGoIdx = 1;
var didEndIdx = 2;
postMessage("Started!");
postMessage("Memory: " + memory);
Atomics.store(memory, didStartIdx, 1);
wake(memory, didStartIdx);
wait(memory, shouldGoIdx, 0, 1);
Atomics.store(memory, didEndIdx, 1);
wake(memory, didEndIdx, 1);
postMessage("Memory: " + memory);
postMessage("done");
}