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

Function CreateThread

test/browser/gl_in_pthread.c:65–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void CreateThread()
66{
67 pthread_attr_t attr;
68 pthread_attr_init(&attr);
69 emscripten_pthread_attr_settransferredcanvases(&attr, "#canvas");
70 int rc = pthread_create(&thread, &attr, ThreadMain, 0);
71 if (rc == ENOSYS)
72 {
73 printf("Test Skipped! OffscreenCanvas is not supported!\n");
74#ifdef REPORT_RESULT
75 REPORT_RESULT(1); // But report success, so that runs on non-supporting browsers don't raise noisy errors.
76#endif
77 exit(0);
78 }
79 if (rc)
80 {
81 printf("Failed to create thread! error: %d\n", rc);
82 exit(0);
83 }
84 pthread_attr_destroy(&attr);
85 ++numThreadsCreated;
86}
87
88void *mymain(void* arg)
89{

Callers 1

mymainFunction · 0.70

Calls 5

pthread_attr_initFunction · 0.85
printfFunction · 0.85
pthread_attr_destroyFunction · 0.85
exitFunction · 0.50

Tested by

no test coverage detected