mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-09 13:01:38 -07:00
Merge pull request #4189 from pkova/master
Fix thread sanitizer errors surfaced by tests/core/io
This commit is contained in:
@@ -338,7 +338,7 @@ atomic_sema_wait :: proc "contextless" (s: ^Atomic_Sema) {
|
||||
original_count := atomic_load_explicit(&s.count, .Relaxed)
|
||||
for original_count == 0 {
|
||||
futex_wait(&s.count, u32(original_count))
|
||||
original_count = s.count
|
||||
original_count = atomic_load_explicit(&s.count, .Relaxed)
|
||||
}
|
||||
if original_count == atomic_compare_exchange_strong_explicit(&s.count, original_count, original_count-1, .Acquire, .Acquire) {
|
||||
return
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user