Combine join and destroy for threads

This commit is contained in:
gingerBill
2022-12-20 14:08:24 +00:00
parent a0e3a99dd1
commit 134c7db4d2
2 changed files with 4 additions and 15 deletions

View File

@@ -57,14 +57,9 @@ gb_internal void thread_pool_destroy(ThreadPool *pool) {
for_array(i, pool->threads) {
Thread *t = &pool->threads[i];
thread_join(t);
thread_join_and_destroy(t);
}
for_array(i, pool->threads) {
Thread *t = &pool->threads[i];
thread_destroy(t);
}
gb_free(pool->allocator, pool->threads.data);
mutex_destroy(&pool->mutex);
condition_destroy(&pool->task_cond);