diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-09-08 21:59:55 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-09-09 16:19:15 -0400 |
| commit | c3f363cfbcee453c7d90b37429c92115e91216af (patch) | |
| tree | ef29642518bf489504c9c085d3ab4fda501a4154 /core/thread | |
| parent | dbb783fbf20df1bba899b7a2bcbd65f71eb32fef (diff) | |
Fix data race when `pool_stop_task` is called
Diffstat (limited to 'core/thread')
| -rw-r--r-- | core/thread/thread_pool.odin | 1 |
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 = {} } } |