MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / WakingThread

Function WakingThread

test/pthread/test_futex_wake_all.c:25–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23pthread_t waitingThreads[NUM_THREADS];
24
25void *WakingThread(void *arg) {
26 // Wake all threads waiting for the futex address
27 emscripten_atomic_store_u32(&futexVal, 1);
28 emscripten_futex_wake(&futexVal, INT_MAX);
29
30 pthread_exit(0);
31}
32
33void *WaitingThread(void *arg) {
34 // Last waiting thread creates the waking thread - this simplifies mutual synchronization needs

Callers

nothing calls this directly

Calls 2

emscripten_futex_wakeFunction · 0.50

Tested by

no test coverage detected