Browse Source

Merge pull request #3528 from laytan/fix-some-sync-issues

Fix some sync issues
gingerBill 1 year ago
parent
commit
17a01a81d8
2 changed files with 3 additions and 3 deletions
  1. 1 1
      core/sync/extended.odin
  2. 2 2
      core/sys/darwin/sync.odin

+ 1 - 1
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`.
 // 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) {
 one_shot_event_wait :: proc "contextless" (e: ^One_Shot_Event) {
 	for atomic_load_explicit(&e.state, .Acquire) == 0 {
 	for atomic_load_explicit(&e.state, .Acquire) == 0 {
-		futex_wait(&e.state, 1)
+		futex_wait(&e.state, 0)
 	}
 	}
 }
 }
 
 

+ 2 - 2
core/sys/darwin/sync.odin

@@ -5,9 +5,9 @@ foreign import system "system:System.framework"
 // #define OS_WAIT_ON_ADDR_AVAILABILITY \
 // #define OS_WAIT_ON_ADDR_AVAILABILITY \
 // 	__API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4))
 // 	__API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4))
 when ODIN_OS == .Darwin {
 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
 		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
 		WAIT_ON_ADDRESS_AVAILABLE :: true
 	} else {
 	} else {
 		WAIT_ON_ADDRESS_AVAILABLE :: false
 		WAIT_ON_ADDRESS_AVAILABLE :: false