diff options
author | hiddenpath <hiddenpath@yandex-team.com> | 2024-02-21 23:16:42 +0300 |
---|---|---|
committer | hiddenpath <hiddenpath@yandex-team.com> | 2024-02-21 23:33:25 +0300 |
commit | 9052eb5cc304b8da8885fc4e3364ebddc16945f3 (patch) | |
tree | 3c252f6161dd0745c7732d74c9304c000645ab47 /contrib/libs/cxxsupp/libcxx/src/atomic.cpp | |
parent | f5eb715f103692e7c7536e13bef3f281fd78e5e7 (diff) | |
download | ydb-9052eb5cc304b8da8885fc4e3364ebddc16945f3.tar.gz |
Update libcxx to llvmorg-17.0.6
Update libcxx to llvmorg-17.0.6
c871ef572c71b4fef22d4a9e65bcebc57e625aea
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/src/atomic.cpp')
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/src/atomic.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/src/atomic.cpp b/contrib/libs/cxxsupp/libcxx/src/atomic.cpp index 7777e888c0..a55249a15c 100644 --- a/contrib/libs/cxxsupp/libcxx/src/atomic.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/atomic.cpp @@ -9,11 +9,14 @@ #include <__config> #ifndef _LIBCPP_HAS_NO_THREADS +#include <__thread/timed_backoff_policy.h> #include <atomic> #include <climits> #include <functional> #include <thread> +#include "include/apple_availability.h" + #ifdef __linux__ #include <unistd.h> @@ -77,20 +80,25 @@ static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const vo const_cast<__cxx_atomic_contention_t*>(__ptr), 0); } -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8 +/* + * Since __cxx_contention_t is int64_t even on 32bit FreeBSD + * platforms, we have to use umtx ops that work on the long type, and + * limit its use to architectures where long and int64_t are synonyms. + */ static void __libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr, __cxx_contention_t __val) { _umtx_op(const_cast<__cxx_atomic_contention_t*>(__ptr), - UMTX_OP_WAIT_UINT_PRIVATE, __val, NULL, NULL); + UMTX_OP_WAIT, __val, NULL, NULL); } static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const volatile* __ptr, bool __notify_one) { _umtx_op(const_cast<__cxx_atomic_contention_t*>(__ptr), - UMTX_OP_WAKE_PRIVATE, __notify_one ? 1 : INT_MAX, NULL, NULL); + UMTX_OP_WAKE, __notify_one ? 1 : INT_MAX, NULL, NULL); } #else // <- Add other operating systems here |