On Tue Mar 5 18:43:42 2024 +0000, Brendan Shanks wrote:
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?
This added a bit of complexity, but when building agains the 14.4 SDK (just released a few hours ago), it will pick at runtime the new public implementation if available.
When setting the deployment target to 14.4 or higher, clang should even optimize the other code paths away and not weakly link `os_sync_wait_on_address` anymore.