Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107861114
D38132.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38132.diff
View Options
diff --git a/contrib/llvm-project/libcxx/src/atomic.cpp b/contrib/llvm-project/libcxx/src/atomic.cpp
--- a/contrib/llvm-project/libcxx/src/atomic.cpp
+++ b/contrib/llvm-project/libcxx/src/atomic.cpp
@@ -26,6 +26,11 @@
# define SYS_futex SYS_futex_time64
#endif
+#elif defined(__FreeBSD__)
+
+#include <sys/types.h>
+#include <sys/umtx.h>
+
#else // <- Add other operating systems here
// Baseline needs no new headers
@@ -72,6 +77,22 @@
const_cast<__cxx_atomic_contention_t*>(__ptr), 0);
}
+#elif defined(__FreeBSD__) && defined(__LP64__)
+
+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, __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, __notify_one ? 1 : INT_MAX, NULL, NULL);
+}
+
#else // <- Add other operating systems here
// Baseline is just a timed backoff
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 7:24 PM (18 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15956214
Default Alt Text
D38132.diff (1 KB)
Attached To
Mode
D38132: libcxx: Implement atomic::wait/wake using _umtx_op(2) ) for 64bit arches
Attached
Detach File
Event Timeline
Log In to Comment