Brendan Shanks (@bshanks) commented about dlls/ntdll/unix/sync.c:
+ { + errno = ETIMEDOUT; + return -1; + } + return __ulock_wait( UL_COMPARE_AND_WAIT, (void *)addr, (uint64_t)val, us_timeout ); + } + + return __ulock_wait( UL_COMPARE_AND_WAIT, (void *)addr, (uint64_t)val, 0 ); +} + +static inline int futex_wake( const LONG *addr, int val ) +{ + return __ulock_wake( UL_COMPARE_AND_WAIT, (void *)addr, (uint64_t)val ); +} + +#endif /* __APPLE__ */ These APIs are being publicly added to macOS 14.4 (`/usr/include/os/os_sync_wait_on_address.h` in Xcode 15.3, set for release any day now). Could this be implemented using that API, but use a fallback implementation (implemented with the private ulock APIs) when not building against/running on 14.4?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5237#note_63568