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

Function CreateThread

test/pthread/test_pthread_create.c:57–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55pthread_t thread[NUM_THREADS];
56
57void CreateThread(intptr_t i) {
58 static int counter = 1;
59 // Arbitrary random'ish data for perturbing the sort for this thread task.
60 global_shared_data[i] = (counter++ * 12141231) & 0x7FFFFFFF;
61 // emscripten_outf("Main: Creating thread idx %d (param %d)", i, global_shared_data[i]);
62 int rc = pthread_create(&thread[i], NULL, ThreadMain, (void*)i);
63 assert(rc == 0);
64}
65
66int main() {
67 // Create initial threads.

Callers 1

mainFunction · 0.70

Calls 1

assertFunction · 0.50

Tested by

no test coverage detected