diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-09-08 17:54:45 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-09-09 16:19:14 -0400 |
| commit | cbd4d5e765646ef07c4133ab65e06652a87a1916 (patch) | |
| tree | 8ba0befaca4403f7a7bf18a1a3135a94aee30fd9 /core/sync | |
| parent | 74b28f1ff91d4776475f4009fa2bcda71c655cd5 (diff) | |
Fix data race in `atomic_sema_wait_with_timeout`
Diffstat (limited to 'core/sync')
| -rw-r--r-- | core/sync/primitives_atomic.odin | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/sync/primitives_atomic.odin b/core/sync/primitives_atomic.odin index 1d8e423db..076a74b20 100644 --- a/core/sync/primitives_atomic.odin +++ b/core/sync/primitives_atomic.odin @@ -361,7 +361,7 @@ atomic_sema_wait_with_timeout :: proc "contextless" (s: ^Atomic_Sema, duration: if !futex_wait_with_timeout(&s.count, u32(original_count), remaining) { return false } - 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 true |