[libcxx-commits] [PATCH] D66301: [libcxx] __thread_id should be available when an external threading API is used.

David Spickett via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 15 08:56:43 PDT 2019


DavidSpickett created this revision.
DavidSpickett added a reviewer: mclow.lists.
Herald added a reviewer: EricWF.
Herald added a subscriber: christof.

Commit r368867 "Fix a layering violation in mutex"
moved "__thread_id" from <thread> to <__threading_support>.

Along the way the conditions for its presence changed.
Before it only required that threading was supported.
Now it needs that and you not to be using an external
API.

This change restores the old behaviour by putting it
in a separate block with the correct condition.


https://reviews.llvm.org/D66301

Files:
  libcxx/include/__threading_support


Index: libcxx/include/__threading_support
===================================================================
--- libcxx/include/__threading_support
+++ libcxx/include/__threading_support
@@ -395,6 +395,19 @@
 
 #endif // !_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL || _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL
 
+_LIBCPP_END_NAMESPACE_STD
+
+_LIBCPP_POP_MACROS
+
+#endif // !_LIBCPP_HAS_NO_THREADS and !_LIBCPP_HAS_THREAD_API_EXTERNAL
+
+#if !defined(_LIBCPP_HAS_NO_THREADS)
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
 class _LIBCPP_TYPE_VIS thread;
 class _LIBCPP_TYPE_VIS __thread_id;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66301.215411.patch
Type: text/x-patch
Size: 622 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190815/c5fdbaa4/attachment.bin>


More information about the libcxx-commits mailing list