UNPKG
atomics-sync
Version:
latest (1.0.3)
1.0.3
1.0.2
1.0.1
1.0.0
JavaScript multithreading synchronization library
github.com/slavamuravey/atomics-sync
atomics-sync
/
src
/
workers
/
semaphore
/
notificator.mjs
11 lines
(7 loc)
•
205 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{ workerData }
from
"worker_threads"
;
import
{
Semaphore
}
from
"../../../dist/index.js"
;
const
{ sem, shared } = workerData;
setTimeout
(
() =>
{ shared[
0
] =
42
;
Semaphore
.
post
(sem); },
100
);