]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Add platform wait functions for Darwin [PR120527]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 5 Dec 2025 15:47:10 +0000 (15:47 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 21 Apr 2026 14:22:28 +0000 (15:22 +0100)
commita261719a1fc474d7ec00a59b6e0218f5c851c109
treec078b08be35af4ddd48bb65f86376aa8644dc9ad
parent6adc49fc08cb87b0e7c8ead3176b45dae2ff4e2a
libstdc++: Add platform wait functions for Darwin [PR120527]

Darwin has kernel support for this facility from 10.12 (macOS Sierra).

From 10.15 (macOS Catalina) 64bit qualitities are supported.

When the library is built for 10.12+ both 32b and 64b quantities will be
supported by the DSO which means it can be installed on 10.12+ with support
for 64bit available when the instalation is >= 10.15.

The header will only recognise 64b quantities when the deployment version
is >= 10.15.

If the library is built for <= 10.11, the support will be missing and attempts
to use it wlll result in link errors.

The platform wait type is unconditionally set to 32bits, since this is compatible
across supported OS editions.

PR libstdc++/120527

libstdc++-v3/ChangeLog:

* include/bits/atomic_wait.h:
* src/c++20/atomic.cc (__ulock_wait): Enable supported Darwin versions.
(__ulock_wake): Likewise.
(UL_COMPARE_AND_WAIT): New.
(UL_COMPARE_AND_WAIT64): New.
(ULF_WAKE_ALL): New.
(_GLIBCXX_HAVE_PLATFORM_WAIT): Enable for suppported Darwin versions.

Co-authored-by: Iain Sandoe <iain@sandoe.co.uk>
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libstdc++-v3/include/bits/atomic_wait.h
libstdc++-v3/src/c++20/atomic.cc