aboutsummaryrefslogtreecommitdiff
path: root/core/thread
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2024-09-08 21:59:55 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2024-09-09 16:19:15 -0400
commitc3f363cfbcee453c7d90b37429c92115e91216af (patch)
treeef29642518bf489504c9c085d3ab4fda501a4154 /core/thread
parentdbb783fbf20df1bba899b7a2bcbd65f71eb32fef (diff)
Fix data race when `pool_stop_task` is called
Diffstat (limited to 'core/thread')
-rw-r--r--core/thread/thread_pool.odin1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/thread/thread_pool.odin b/core/thread/thread_pool.odin
index 9bcc42968..d9166b450 100644
--- a/core/thread/thread_pool.odin
+++ b/core/thread/thread_pool.odin
@@ -60,6 +60,7 @@ pool_thread_runner :: proc(t: ^Thread) {
if task, ok := pool_pop_waiting(pool); ok {
data.task = task
pool_do_work(pool, task)
+ sync.guard(&pool.mutex)
data.task = {}
}
}