aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-04-27 15:57:47 +0100
committergingerBill <bill@gingerbill.org>2022-04-27 15:57:47 +0100
commit10cd294cf2b64ae6d5c7e8a470d074e2c48eb4cb (patch)
tree1c26f506b8c229f01fc77fc3825316ed5d96bf26 /core
parentd6cfb6050613872c3ae70cbbe446276cec4ded12 (diff)
Use Acquire semantics for the `futex_wait` load shortcut
Diffstat (limited to 'core')
-rw-r--r--core/sync/primitives.odin4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/sync/primitives.odin b/core/sync/primitives.odin
index 483f85343..bfbdc6f9b 100644
--- a/core/sync/primitives.odin
+++ b/core/sync/primitives.odin
@@ -195,7 +195,7 @@ sema_wait_with_timeout :: proc(s: ^Sema, duration: time.Duration) -> bool {
Futex :: distinct u32
futex_wait :: proc(f: ^Futex, expected: u32) {
- if u32(atomic_load(f)) != expected {
+ if u32(atomic_load_explicit(f, .Acquire)) != expected {
return
}
@@ -204,7 +204,7 @@ futex_wait :: proc(f: ^Futex, expected: u32) {
// returns true if the wait happened within the duration, false if it exceeded the time duration
futex_wait_with_timeout :: proc(f: ^Futex, expected: u32, duration: time.Duration) -> bool {
- if u32(atomic_load(f)) != expected {
+ if u32(atomic_load_explicit(f, .Acquire)) != expected {
return true
}
if duration <= 0 {