aboutsummaryrefslogtreecommitdiff
path: root/core/thread/thread_pool.odin
diff options
context:
space:
mode:
authorpkova <pyry@urbit.org>2024-09-03 16:30:51 +0300
committerpkova <pyry@urbit.org>2024-09-03 16:30:51 +0300
commit5b9b21e756ac47b5c4c9683c6fff861158b627d4 (patch)
tree01236445f14437cae2dc5aa2282661a98036d300 /core/thread/thread_pool.odin
parentd93aca647bd3b46e3160934a61a84762fb97a889 (diff)
Fix thread sanitizer errors surfaced by tests/core/io
Diffstat (limited to 'core/thread/thread_pool.odin')
-rw-r--r--core/thread/thread_pool.odin5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/thread/thread_pool.odin b/core/thread/thread_pool.odin
index 7e2489013..9bcc42968 100644
--- a/core/thread/thread_pool.odin
+++ b/core/thread/thread_pool.odin
@@ -122,9 +122,10 @@ pool_join :: proc(pool: ^Pool) {
for started_count < len(pool.threads) {
started_count = 0
for t in pool.threads {
- if .Started in t.flags {
+ flags := intrinsics.atomic_load(&t.flags)
+ if .Started in flags {
started_count += 1
- if .Joined not_in t.flags {
+ if .Joined not_in flags {
join(t)
}
}