浏览代码

Set thread pool `is_running` to false on shutdown

Feoramund 1 年之前
父节点
当前提交
9dcf345795
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      core/thread/thread_pool.odin

+ 1 - 0
core/thread/thread_pool.odin

@@ -225,6 +225,7 @@ pool_stop_all_tasks :: proc(pool: ^Pool, exit_code: int = 1) {
 //
 // The pool must still be destroyed after this.
 pool_shutdown :: proc(pool: ^Pool, exit_code: int = 1) {
+	intrinsics.atomic_store(&pool.is_running, false)
 	sync.guard(&pool.mutex)
 
 	for t in pool.threads {