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

Function CreateThread

test/other/test_malloc_multithreading.c:73–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void CreateThread(int i) {
74 pthread_attr_t attr;
75 pthread_attr_init(&attr);
76 pthread_attr_setstacksize(&attr, 4*1024);
77 int rc = pthread_create(&thread[i], &attr, ThreadMain, 0);
78 if (rc != 0 || thread[i] == 0) {
79 printf("Failed to create thread!\n");
80 }
81 pthread_attr_destroy(&attr);
82}
83
84int main() {
85 printf("Workers: %d\n", WORKERS);

Callers 1

mainFunction · 0.70

Calls 4

pthread_attr_initFunction · 0.85
printfFunction · 0.85
pthread_attr_destroyFunction · 0.85

Tested by

no test coverage detected