0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-30 09:08:00 -04:00
denoland-deno/cli/tests/workers/shared_array_buffer.ts
Luca Casonato bdfad23dd0
feat: support SharedArrayBuffer sharing between workers (#11040)
This commit adds support for sharing SABs between workers.
2021-07-06 19:42:52 +02:00

9 lines
230 B
TypeScript

self.postMessage("ready");
globalThis.addEventListener("message", (e) => {
const bytes1 = new Uint8Array(e.data[0]);
const bytes2 = new Uint8Array(e.data[1]);
bytes1[0] = 1;
bytes2[0] = 2;
self.postMessage("done");
});