[libcxx-commits] [libcxx] db757ba - [libc++] Define _LIBCPP_NO_NATIVE_SEMAPHORES even outside of pthread
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jun 3 15:19:38 PDT 2021
Author: Louis Dionne
Date: 2021-06-03T18:18:42-04:00
New Revision: db757ba7c523f8a456f884316a44c0f1124bcb9a
URL: https://github.com/llvm/llvm-project/commit/db757ba7c523f8a456f884316a44c0f1124bcb9a
DIFF: https://github.com/llvm/llvm-project/commit/db757ba7c523f8a456f884316a44c0f1124bcb9a.diff
LOG: [libc++] Define _LIBCPP_NO_NATIVE_SEMAPHORES even outside of pthread
<semaphore> needs to know about whether native semaphores are supported
or not, even if we're not using the pthread API.
Added:
Modified:
libcxx/include/__threading_support
Removed:
################################################################################
diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support
index 788cae853e58..4d867167c2b1 100644
--- a/libcxx/include/__threading_support
+++ b/libcxx/include/__threading_support
@@ -29,14 +29,15 @@
# include <__external_threading>
#elif !defined(_LIBCPP_HAS_NO_THREADS)
+#if defined(__APPLE__) || defined(__MVS__)
+# define _LIBCPP_NO_NATIVE_SEMAPHORES
+#endif
+
#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
# include <pthread.h>
# include <sched.h>
-# if defined(__APPLE__) || defined(__MVS__)
-# define _LIBCPP_NO_NATIVE_SEMAPHORES
-# endif
# ifndef _LIBCPP_NO_NATIVE_SEMAPHORES
-# include <semaphore.h>
+# include <semaphore.h>
# endif
#elif defined(_LIBCPP_HAS_THREAD_API_C11)
# include <threads.h>
More information about the libcxx-commits
mailing list