From b1db33b519bf52e2d0e6e42ca9daccc7470d6b8b Mon Sep 17 00:00:00 2001 From: Feoramund <161657516+Feoramund@users.noreply.github.com> Date: Tue, 10 Sep 2024 19:04:44 -0400 Subject: [PATCH] Add `cpu_relax` to `sync.auto_reset_event_signal` --- core/sync/extended.odin | 1 + 1 file changed, 1 insertion(+) diff --git a/core/sync/extended.odin b/core/sync/extended.odin index 0971516a3..0b1f79df2 100644 --- a/core/sync/extended.odin +++ b/core/sync/extended.odin @@ -233,6 +233,7 @@ auto_reset_event_signal :: proc "contextless" (e: ^Auto_Reset_Event) { if _, ok := atomic_compare_exchange_weak_explicit(&e.status, old_status, new_status, .Release, .Relaxed); ok { break } + cpu_relax() } if old_status < 0 { sema_post(&e.sema)