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

Function c3

test/browser/test_worker_api_2.c:27–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25int c3_7 = 0, c3_8 = 0;
26
27void c3(char *data, int size, void *arg) { // tests calls different in different workers.
28 int calls = *((int*)data);
29 printf("%ld: %d\n", (long)arg, calls);
30 if ((long)arg == 7) {
31 assert(c3_7 == 0);
32 c3_7++;
33 assert(calls == 5);
34 } else {
35 assert((long)arg == 8);
36 assert(c3_8 == 0);
37 c3_8++;
38 assert(calls == 1);
39 }
40 if (c3_7 && c3_8) { // note: racy, responses from 2 workers here
41 emscripten_destroy_worker(w1);
42 REPORT_RESULT(11);
43 emscripten_force_exit(0);
44 }
45}
46
47void c2(char *data, int size, void *arg) { // tests queuing up several messages, each with different data
48 assert((long)arg == stage);

Callers

nothing calls this directly

Calls 2

printfFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected