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

Function wait

test/pthread/test_pthread_clock_drift.c:17–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15volatile double mainThreadTime;
16
17void wait(volatile int *address) {
18 int state = emscripten_atomic_load_u32((void*)address);
19 while (state == 0) {
20 state = emscripten_atomic_load_u32((void*)address);
21 }
22}
23
24void wake(volatile int *address) {
25 emscripten_atomic_store_u32((void*)address, 1);

Callers 2

thread_mainFunction · 0.70
mainFunction · 0.70

Calls 1

Tested by

no test coverage detected