mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fixed thread_pool not destroying threads
This commit is contained in:
@@ -70,6 +70,11 @@ pool_init :: proc(pool: ^Pool, thread_count: int, allocator := context.allocator
|
|||||||
|
|
||||||
pool_destroy :: proc(pool: ^Pool) {
|
pool_destroy :: proc(pool: ^Pool) {
|
||||||
delete(pool.tasks);
|
delete(pool.tasks);
|
||||||
|
|
||||||
|
for thread in &pool.threads {
|
||||||
|
destroy(thread);
|
||||||
|
}
|
||||||
|
|
||||||
delete(pool.threads, pool.allocator);
|
delete(pool.threads, pool.allocator);
|
||||||
|
|
||||||
sync.mutex_destroy(&pool.mutex);
|
sync.mutex_destroy(&pool.mutex);
|
||||||
|
|||||||
Reference in New Issue
Block a user