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

Function ThreadMain

test/core/pthread/create.c:19–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17static _Atomic int sum;
18
19void *ThreadMain(void *arg) {
20 for (int i = 0; i < TOTAL; i++) {
21 // wait for a change, so we see interleaved processing.
22 int last = ++sum;
23 while (sum == last) {}
24 }
25 pthread_exit((void*)TOTAL);
26}
27
28pthread_t thread[NUM_THREADS];
29

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected