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

Function main

test/other/test_malloc_multithreading.c:84–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84int main() {
85 printf("Workers: %d\n", WORKERS);
86 assert(WORKERS < MAX_WORKERS);
87
88#if WORKERS > 1
89 // Create new threads.
90 for (int i = 0; i < WORKERS; ++i) {
91 CreateThread(i);
92 }
93#endif
94
95#if VERBOSE
96 start = emscripten_date_now();
97#endif
98
99#if WORKERS > 1
100 // Join the threads as they complete their work.
101 for (int i = 0; i < WORKERS; ++i) {
102 void *status;
103 pthread_join(thread[i], &status);
104 }
105#else
106 // One worker, just run it.
107 ThreadMain(NULL);
108#endif
109}

Callers

nothing calls this directly

Calls 5

printfFunction · 0.85
emscripten_date_nowFunction · 0.85
CreateThreadFunction · 0.70
ThreadMainFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected