diff options
| author | gingerBill <bill@gingerbill.org> | 2022-03-31 10:55:18 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-03-31 10:55:18 +0100 |
| commit | 06e8476efc421a27ea8cd908cd5e6d8b319ebf0f (patch) | |
| tree | 2d8bb4cca1a17c08542612507ef93a4768ec129b /core | |
| parent | 94dbac9a647fb050f3a818275111d8f7496ffd37 (diff) | |
Correct ordering in `auto_reset_event_signal`
Diffstat (limited to 'core')
| -rw-r--r-- | core/sync/extended.odin | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/sync/extended.odin b/core/sync/extended.odin index 23423e003..c8ae4493f 100644 --- a/core/sync/extended.odin +++ b/core/sync/extended.odin @@ -146,10 +146,10 @@ Auto_Reset_Event :: struct { } auto_reset_event_signal :: proc(e: ^Auto_Reset_Event) { - old_status := atomic_load_explicit(&e.status, .seq_cst) + old_status := atomic_load_explicit(&e.status, .relaxed) for { new_status := old_status + 1 if old_status < 1 else 1 - if _, ok := atomic_compare_exchange_weak_explicit(&e.status, old_status, new_status, .seq_cst, .seq_cst); ok { + if _, ok := atomic_compare_exchange_weak_explicit(&e.status, old_status, new_status, .release, .relaxed); ok { break } |