Fix thread sanitizer errors surfaced by tests/core/io

This commit is contained in:
pkova
2024-09-03 16:30:51 +03:00
parent d93aca647b
commit 5b9b21e756
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -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)
}
}