- for (int i = 0; i <= MAX_THREADS; i++)
- {
- assert(threads[i].do_sleep);
-
- threads[i].do_exit = true; // Search must be already finished
- threads[i].wake_up();
-
- thread_join(threads[i].handle); // Wait for thread termination
-
- lock_destroy(threads[i].sleepLock);
- cond_destroy(threads[i].sleepCond);
-
- for (int j = 0; j < MAX_SPLITPOINTS_PER_THREAD; j++)
- lock_destroy(threads[i].splitPoints[j].lock);
- }