[libcxx-commits] [PATCH] D76632: [libc++] Do not use futex if LIBCXX_HAS_MUSL_LIBC is ON

Pengxuan Zheng via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 23 11:28:21 PDT 2020

pzheng created this revision.
Herald added subscribers: libcxx-commits, krytarowski.
Herald added a project: libc++.
Herald added a reviewer: libc++.
pzheng added reviewers: __simt__, apazos, bcain, sidneym.

Futex is not available with musl libc.

  rG LLVM Github Monorepo



Index: libcxx/src/atomic.cpp
--- libcxx/src/atomic.cpp
+++ libcxx/src/atomic.cpp
@@ -15,7 +15,7 @@
 #include <iostream>
-#ifdef __linux__
+#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)
 #include <unistd.h>
 #include <linux/futex.h>
@@ -29,7 +29,7 @@
-#ifdef __linux__
+#if defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC)
 static void __libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr,
                                               __cxx_contention_t __val)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76632.252100.patch
Type: text/x-patch
Size: 617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200323/1e23bb0c/attachment.bin>

More information about the libcxx-commits mailing list