Skip to content

Commit 6b23e11

Browse files
committed
Ensure no zero timeouts on macos
1 parent 8925479 commit 6b23e11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/macos.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl ECMAScriptAtomicWaitImpl for Racy<'_, u32> {
2020
size_of::<Self>(),
2121
libc::OS_SYNC_WAIT_ON_ADDRESS_NONE,
2222
libc::CLOCK_MONOTONIC,
23-
time.as_nanos().min(u64::MAX as u128) as u64,
23+
(time.as_nanos().min(u64::MAX as u128) as u64).max(1),
2424
)
2525
} else {
2626
libc::os_sync_wait_on_address(
@@ -96,7 +96,7 @@ impl ECMAScriptAtomicWaitImpl for Racy<'_, u64> {
9696
size_of::<Self>(),
9797
libc::OS_SYNC_WAIT_ON_ADDRESS_NONE,
9898
libc::CLOCK_MONOTONIC,
99-
time.as_nanos().min(u64::MAX as u128) as u64,
99+
(time.as_nanos().min(u64::MAX as u128) as u64).max(1),
100100
)
101101
} else {
102102
libc::os_sync_wait_on_address(

0 commit comments

Comments
 (0)