| 25 | int c3_7 = 0, c3_8 = 0; |
| 26 | |
| 27 | void 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 | |
| 47 | void c2(char *data, int size, void *arg) { // tests queuing up several messages, each with different data |
| 48 | assert((long)arg == stage); |