| 55 | pthread_t thread[NUM_THREADS]; |
| 56 | |
| 57 | void CreateThread(intptr_t i) { |
| 58 | static int counter = 1; |
| 59 | // Arbitrary random'ish data for perturbing the sort for this thread task. |
| 60 | global_shared_data[i] = (counter++ * 12141231) & 0x7FFFFFFF; |
| 61 | // emscripten_outf("Main: Creating thread idx %d (param %d)", i, global_shared_data[i]); |
| 62 | int rc = pthread_create(&thread[i], NULL, ThreadMain, (void*)i); |
| 63 | assert(rc == 0); |
| 64 | } |
| 65 | |
| 66 | int main() { |
| 67 | // Create initial threads. |