[libcxx-commits] [libcxx] r369399 - Fix availability of __thread_id on builds with external threading. Reviewed as https://reviews.llvm.org/D66480
Marshall Clow via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Aug 20 09:16:24 PDT 2019
Author: marshall
Date: Tue Aug 20 09:16:23 2019
New Revision: 369399
URL: http://llvm.org/viewvc/llvm-project?rev=369399&view=rev
Log:
Fix availability of __thread_id on builds with external threading. Reviewed as https://reviews.llvm.org/D66480
Modified:
libcxx/trunk/include/__threading_support
Modified: libcxx/trunk/include/__threading_support
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__threading_support?rev=369399&r1=369398&r2=369399&view=diff
==============================================================================
--- libcxx/trunk/include/__threading_support (original)
+++ libcxx/trunk/include/__threading_support Tue Aug 20 09:16:23 2019
@@ -23,16 +23,11 @@
# include <__external_threading>
#elif !defined(_LIBCPP_HAS_NO_THREADS)
-typedef ::timespec __libcpp_timespec_t;
-
#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
# include <pthread.h>
# include <sched.h>
#endif
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
#if defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) || \
defined(_LIBCPP_HAS_THREAD_API_WIN32)
@@ -47,8 +42,16 @@ _LIBCPP_PUSH_MACROS
#define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
#endif
+typedef ::timespec __libcpp_timespec_t;
+#endif // !defined(_LIBCPP_HAS_NO_THREADS)
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
+#if !defined(_LIBCPP_HAS_NO_THREADS)
+
#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
// Mutex
typedef pthread_mutex_t __libcpp_mutex_t;
@@ -109,7 +112,7 @@ typedef void* __libcpp_thread_t;
typedef long __libcpp_tls_key;
#define _LIBCPP_TLS_DESTRUCTOR_CC __stdcall
-#endif
+#endif // defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
// Mutex
_LIBCPP_THREAD_ABI_VISIBILITY
@@ -475,10 +478,10 @@ get_id() _NOEXCEPT
} // this_thread
+#endif // !_LIBCPP_HAS_NO_THREADS
+
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // !_LIBCPP_HAS_NO_THREADS
-
#endif // _LIBCPP_THREADING_SUPPORT
More information about the libcxx-commits
mailing list