git: c8d8e959b51a - stable/13 - libcxx: add comment explaining why umtx is only used for 64bits
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 31 Jan 2023 00:39:08 UTC
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=c8d8e959b51a47a623a0c46d5966009455912f04
commit c8d8e959b51a47a623a0c46d5966009455912f04
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-01-24 15:36:24 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-01-31 00:38:18 +0000
libcxx: add comment explaining why umtx is only used for 64bits
(cherry picked from commit 4c4a29267cbdd05471322e03bfd5eff8eb68e750)
---
contrib/llvm-project/libcxx/src/atomic.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/contrib/llvm-project/libcxx/src/atomic.cpp b/contrib/llvm-project/libcxx/src/atomic.cpp
index 6f85c86aad8f..7bd9205a963b 100644
--- a/contrib/llvm-project/libcxx/src/atomic.cpp
+++ b/contrib/llvm-project/libcxx/src/atomic.cpp
@@ -78,6 +78,11 @@ static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const vo
}
#elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8 && !defined(__mips__)
+/*
+ * 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)