mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-04 04:02:33 +00:00
Combine join and destroy for threads
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user