From 8506e643451edd0a474e7e368afb7db6c71f8ea8 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Thu, 2 May 2024 20:49:29 +0200 Subject: [PATCH 1/2] sync: fix deadlock in one shot event --- core/sync/extended.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sync/extended.odin b/core/sync/extended.odin index 76b7686fe..781ed816e 100644 --- a/core/sync/extended.odin +++ b/core/sync/extended.odin @@ -433,7 +433,7 @@ One_Shot_Event :: struct #no_copy { // Blocks the current thread until the event is made available with `one_shot_event_signal`. one_shot_event_wait :: proc "contextless" (e: ^One_Shot_Event) { for atomic_load_explicit(&e.state, .Acquire) == 0 { - futex_wait(&e.state, 1) + futex_wait(&e.state, 0) } } From 8aab395c7028136137385b9ac38512773580a454 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Thu, 2 May 2024 20:49:54 +0200 Subject: [PATCH 2/2] darwin: fix minimum os version check not being inclusive --- core/sys/darwin/sync.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/sys/darwin/sync.odin b/core/sys/darwin/sync.odin index c76b30d6b..361b4b8b4 100644 --- a/core/sys/darwin/sync.odin +++ b/core/sys/darwin/sync.odin @@ -5,9 +5,9 @@ foreign import system "system:System.framework" // #define OS_WAIT_ON_ADDR_AVAILABILITY \ // __API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4)) when ODIN_OS == .Darwin { - when ODIN_PLATFORM_SUBTARGET == .iOS && ODIN_MINIMUM_OS_VERSION > 17_04_00 { + when ODIN_PLATFORM_SUBTARGET == .iOS && ODIN_MINIMUM_OS_VERSION >= 17_04_00 { WAIT_ON_ADDRESS_AVAILABLE :: true - } else when ODIN_MINIMUM_OS_VERSION > 14_04_00 { + } else when ODIN_MINIMUM_OS_VERSION >= 14_04_00 { WAIT_ON_ADDRESS_AVAILABLE :: true } else { WAIT_ON_ADDRESS_AVAILABLE :: false