[libcxx-commits] [libcxx] [libc++] Fix FreeBSD atomic timed wait system call (PR #180400)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 11 05:53:54 PST 2026


================
@@ -130,22 +130,20 @@ static void __platform_wake_by_address(void const* __ptr, bool __notify_one) {
 template <std::size_t _Size>
 static void __platform_wait_on_address(void const* __ptr, void const* __val, uint64_t __timeout_ns) {
   static_assert(_Size == 8, "Can only wait on 8 bytes value");
----------------
huixie90 wrote:

So If I understand correctly, FreeBSD is stuck at the old ABI, which it is ever only going to call the platform wait with `__cxx_contention_t` which is defined as 8 bytes on FreeBSD.  Under the 32 bit platform, I believe FreeBSD falls back to the fallback implementation (while loop poll with sleep). 

 This template parameter is added for the new unstable ABI. However, I only implemented the multiple size support for Apple platform's unstable ABI. Vendors are free to update their code under the unstable ABI to add more support for more . 
https://github.com/llvm/llvm-project/blob/main/libcxx/include/__atomic/atomic_waitable_traits.h#L70
(note this file also has alignment problem which I am fixing on another patch)

https://github.com/llvm/llvm-project/pull/180400


More information about the libcxx-commits mailing list