| 82 | } |
| 83 | |
| 84 | int 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 | } |
nothing calls this directly
no test coverage detected