<div dir="ltr">Hi David,<div><br></div><div>Thanks for the information. Looking into it now.</div><div><br></div><div>/Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 6, 2017 at 4:02 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Fri, Jan 6, 2017 at 12:16 PM Eric Fiselier via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ericwf<br class="m_-8899661437054950971gmail_msg">
Date: Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
New Revision: 291275<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=291275&view=rev" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=291275&view=rev</a><br class="m_-8899661437054950971gmail_msg">
Log:<br class="m_-8899661437054950971gmail_msg">
[libc++] Cleanup and document <__threading_support><br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Summary:<br class="m_-8899661437054950971gmail_msg">
This patch attempts to clean up the macro configuration mess in `<__threading_support>`, specifically the mess involving external threading variants. Additionally this patch adds design documentation for `<__threading_support>` and the configuration macros it uses.<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
The primary change in this patch is separating the idea of an "external API" provided by `<__external_threading>` and the idea of having an external threading library. Now `_LIBCPP_HAS_THREAD_API_<wbr>EXTERNAL` means that libc++ should use `<__external_threading>` and that the header is expected to exist.  Additionally the new macro `_LIBCPP_HAS_THREAD_LIBRARY_<wbr>EXTERNAL` is now used to configure for using an "external library"  with the default threading API.<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Reviewers: compnerd, rmaprath<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Subscribers: smeenai, cfe-commits, mgorny<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Differential Revision: <a href="https://reviews.llvm.org/D28316" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">https://reviews.llvm.org/<wbr>D28316</a><br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Added:<br class="m_-8899661437054950971gmail_msg">
    libcxx/trunk/docs/DesignDocs/<wbr>ThreadingSupportAPI.rst<br class="m_-8899661437054950971gmail_msg">
Modified:<br class="m_-8899661437054950971gmail_msg">
    libcxx/trunk/CMakeLists.txt<br class="m_-8899661437054950971gmail_msg">
    libcxx/trunk/docs/index.rst<br class="m_-8899661437054950971gmail_msg">
    libcxx/trunk/include/__config<br class="m_-8899661437054950971gmail_msg">
    libcxx/trunk/include/__<a href="http://config_site.in" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">config_<wbr>site.in</a><br class="m_-8899661437054950971gmail_msg">
    libcxx/trunk/include/__<wbr>threading_support<br class="m_-8899661437054950971gmail_msg">
    libcxx/trunk/lib/CMakeLists.<wbr>txt<br class="m_-8899661437054950971gmail_msg">
    libcxx/trunk/test/CMakeLists.<wbr>txt<br class="m_-8899661437054950971gmail_msg">
    libcxx/trunk/test/<a href="http://lit.site.cfg.in" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">lit.site.<wbr>cfg.in</a><br class="m_-8899661437054950971gmail_msg">
    libcxx/trunk/test/support/<wbr>external_threads.cpp<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Modified: libcxx/trunk/CMakeLists.txt<br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=291275&r1=291274&r2=291275&view=diff" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/<wbr>CMakeLists.txt?rev=291275&r1=<wbr>291274&r2=291275&view=diff</a><br class="m_-8899661437054950971gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-8899661437054950971gmail_msg">
--- libcxx/trunk/CMakeLists.txt (original)<br class="m_-8899661437054950971gmail_msg">
+++ libcxx/trunk/CMakeLists.txt Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
@@ -169,6 +169,9 @@ option(LIBCXX_HAS_PTHREAD_API "Ignore au<br class="m_-8899661437054950971gmail_msg">
 option(LIBCXX_HAS_EXTERNAL_<wbr>THREAD_API<br class="m_-8899661437054950971gmail_msg">
   "Build libc++ with an externalized threading API.<br class="m_-8899661437054950971gmail_msg">
    This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON." OFF)<br class="m_-8899661437054950971gmail_msg">
+option(LIBCXX_BUILD_EXTERNAL_<wbr>THREAD_LIBRARY<br class="m_-8899661437054950971gmail_msg">
+    "Build libc++ with an externalized threading library.<br class="m_-8899661437054950971gmail_msg">
+     This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON" OFF)<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 # Misc options ------------------------------<wbr>------------------------------<wbr>----<br class="m_-8899661437054950971gmail_msg">
 # FIXME: Turn -pedantic back ON. It is currently off because it warns<br class="m_-8899661437054950971gmail_msg">
@@ -230,6 +233,17 @@ if(NOT LIBCXX_ENABLE_THREADS)<br class="m_-8899661437054950971gmail_msg">
     message(FATAL_ERROR "LIBCXX_HAS_EXTERNAL_THREAD_<wbr>API can only be set to ON"<br class="m_-8899661437054950971gmail_msg">
                         " when LIBCXX_ENABLE_THREADS is also set to ON.")<br class="m_-8899661437054950971gmail_msg">
   endif()<br class="m_-8899661437054950971gmail_msg">
+  if (LIBCXX_BUILD_EXTERNAL_THREAD_<wbr>LIBRARY)<br class="m_-8899661437054950971gmail_msg">
+    message(FATAL_ERROR "LIBCXX_BUILD_EXTERNAL_THREAD_<wbr>LIBRARY can only be set "<br class="m_-8899661437054950971gmail_msg">
+                        "to ON when LIBCXX_ENABLE_THREADS is also set to ON.")<br class="m_-8899661437054950971gmail_msg">
+  endif()<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+endif()<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+if (LIBCXX_BUILD_EXTERNAL_THREAD_<wbr>LIBRARY AND LIBCXX_HAS_EXTERNAL_THREAD_<wbr>API)<br class="m_-8899661437054950971gmail_msg">
+  message(FATAL_ERROR "The options LIBCXX_BUILD_EXTERNAL_THREAD_<wbr>LIBRARY and "<br class="m_-8899661437054950971gmail_msg">
+                      "LIBCXX_HAS_EXTERNAL_THREAD_<wbr>API cannot both be ON at "<br class="m_-8899661437054950971gmail_msg">
+                      "the same time")<br class="m_-8899661437054950971gmail_msg">
 endif()<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 if(LIBCXX_HAS_PTHREAD_API AND LIBCXX_HAS_EXTERNAL_THREAD_<wbr>API)<br class="m_-8899661437054950971gmail_msg">
@@ -520,6 +534,7 @@ config_define_if_not(LIBCXX_<wbr>ENABLE_THREA<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 config_define_if(LIBCXX_HAS_<wbr>PTHREAD_API _LIBCPP_HAS_THREAD_API_<wbr>PTHREAD)<br class="m_-8899661437054950971gmail_msg">
 config_define_if(LIBCXX_HAS_<wbr>EXTERNAL_THREAD_API _LIBCPP_HAS_THREAD_API_<wbr>EXTERNAL)<br class="m_-8899661437054950971gmail_msg">
+config_define_if(LIBCXX_<wbr>BUILD_EXTERNAL_THREAD_LIBRARY _LIBCPP_HAS_THREAD_LIBRARY_<wbr>EXTERNAL)<br class="m_-8899661437054950971gmail_msg">
 config_define_if(LIBCXX_HAS_<wbr>MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC)<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 # By default libc++ on Windows expects to use a shared library, which requires<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Added: libcxx/trunk/docs/DesignDocs/<wbr>ThreadingSupportAPI.rst<br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/ThreadingSupportAPI.rst?rev=291275&view=auto" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/docs/<wbr>DesignDocs/<wbr>ThreadingSupportAPI.rst?rev=<wbr>291275&view=auto</a><br class="m_-8899661437054950971gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-8899661437054950971gmail_msg">
--- libcxx/trunk/docs/DesignDocs/<wbr>ThreadingSupportAPI.rst (added)<br class="m_-8899661437054950971gmail_msg">
+++ libcxx/trunk/docs/DesignDocs/<wbr>ThreadingSupportAPI.rst Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
@@ -0,0 +1,70 @@<br class="m_-8899661437054950971gmail_msg">
+=====================<br class="m_-8899661437054950971gmail_msg">
+Threading Support API<br class="m_-8899661437054950971gmail_msg">
+=====================<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+.. contents::<br class="m_-8899661437054950971gmail_msg">
+   :local:<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+Overview<br class="m_-8899661437054950971gmail_msg">
+========<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+Libc++ supports using multiple different threading models and configurations<br class="m_-8899661437054950971gmail_msg">
+to implement the threading parts of libc++, including ``<thread>`` and ``<mutex>``.<br class="m_-8899661437054950971gmail_msg">
+These different models provide entirely different interfaces from each<br class="m_-8899661437054950971gmail_msg">
+other. To address this libc++ wraps the underlying threading API in a new and<br class="m_-8899661437054950971gmail_msg">
+consistent API, which it uses internally to implement threading primitives.<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+The ``<__threading_support>`` header is where libc++ defines its internal<br class="m_-8899661437054950971gmail_msg">
+threading interface. It contains forward declarations of the internal threading<br class="m_-8899661437054950971gmail_msg">
+interface as well as definitions for the interface.<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+External Threading API and the ``<__external_threading>`` header<br class="m_-8899661437054950971gmail_msg">
+=============================<wbr>==============================<wbr>=====<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+In order to support vendors with custom threading API's libc++ allows the<br class="m_-8899661437054950971gmail_msg">
+entire internal threading interface to be provided by an external,<br class="m_-8899661437054950971gmail_msg">
+vendor provided, header.<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+When ``_LIBCPP_HAS_THREAD_API_<wbr>EXTERNAL`` is defined the ``<__threading_support>``<br class="m_-8899661437054950971gmail_msg">
+header simply forwards to the ``<__external_threading>`` header (which must exist).<br class="m_-8899661437054950971gmail_msg">
+It is expected that the ``<__external_threading>`` header provide the exact<br class="m_-8899661437054950971gmail_msg">
+interface normally provided by ``<__threading_support>``.<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+External Threading Library<br class="m_-8899661437054950971gmail_msg">
+==========================<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+Normally ``<__threading_support>`` provides inline definitions to each internal<br class="m_-8899661437054950971gmail_msg">
+threading API function it declares. However libc++ also supports using an<br class="m_-8899661437054950971gmail_msg">
+external library to provide the definitions.<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+When ``_LIBCPP_HAS_THREAD_LIBRARY_<wbr>EXTERNAL`` libc++ does not provide inline<br class="m_-8899661437054950971gmail_msg">
+definitions for the internal API, instead assuming the definitions will be<br class="m_-8899661437054950971gmail_msg">
+provided by an external library.<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+Threading Configuration Macros<br class="m_-8899661437054950971gmail_msg">
+=============================<wbr>=<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+**_LIBCPP_HAS_NO_THREADS**<br class="m_-8899661437054950971gmail_msg">
+  This macro is defined when libc++ is built without threading support. It<br class="m_-8899661437054950971gmail_msg">
+  should not be manually defined by the user.<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+**_LIBCPP_HAS_THREAD_API_<wbr>EXTERNAL**<br class="m_-8899661437054950971gmail_msg">
+  This macro is defined when libc++ should use the ``<__external_threading>``<br class="m_-8899661437054950971gmail_msg">
+  header to provide the internal threading API. This macro overrides<br class="m_-8899661437054950971gmail_msg">
+  ``_LIBCPP_HAS_THREAD_API_<wbr>PTHREAD``.<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+**_LIBCPP_HAS_THREAD_API_<wbr>PTHREAD**<br class="m_-8899661437054950971gmail_msg">
+  This macro is defined when libc++ should use POSIX threads to implement the<br class="m_-8899661437054950971gmail_msg">
+  internal threading API.<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+**_LIBCPP_HAS_THREAD_LIBRARY_<wbr>EXTERNAL**<br class="m_-8899661437054950971gmail_msg">
+  This macro is defined when libc++ expects the definitions of the internal<br class="m_-8899661437054950971gmail_msg">
+  threading API to be provided by an external library. When defined<br class="m_-8899661437054950971gmail_msg">
+  ``<__threading_support>`` will only provide the forward declarations and<br class="m_-8899661437054950971gmail_msg">
+  typedefs for the internal threading API.<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+**_LIBCPP_BUILDING_THREAD_<wbr>LIBRARY_EXTERNAL**<br class="m_-8899661437054950971gmail_msg">
+  This macro is used to build an external threading library using the<br class="m_-8899661437054950971gmail_msg">
+  ``<__threading_support>``. Specifically it exposes the threading API<br class="m_-8899661437054950971gmail_msg">
+  definitions in ``<__threading_support>`` as non-inline definitions meant to<br class="m_-8899661437054950971gmail_msg">
+  be compiled into a library.<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Modified: libcxx/trunk/docs/index.rst<br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/index.rst?rev=291275&r1=291274&r2=291275&view=diff" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/docs/<wbr>index.rst?rev=291275&r1=<wbr>291274&r2=291275&view=diff</a><br class="m_-8899661437054950971gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-8899661437054950971gmail_msg">
--- libcxx/trunk/docs/index.rst (original)<br class="m_-8899661437054950971gmail_msg">
+++ libcxx/trunk/docs/index.rst Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
@@ -131,7 +131,7 @@ Design Documents<br class="m_-8899661437054950971gmail_msg">
    DesignDocs/CapturingConfigInfo<br class="m_-8899661437054950971gmail_msg">
    DesignDocs/ABIVersioning<br class="m_-8899661437054950971gmail_msg">
    DesignDocs/VisibilityMacros<br class="m_-8899661437054950971gmail_msg">
-<br class="m_-8899661437054950971gmail_msg">
+   DesignDocs/<wbr>ThreadingSupportAPI<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 * `<atomic> design <<a href="http://libcxx.llvm.org/atomic_design.html" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://libcxx.llvm.org/<wbr>atomic_design.html</a>>`_<br class="m_-8899661437054950971gmail_msg">
 * `<type_traits> design <<a href="http://libcxx.llvm.org/type_traits_design.html" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://libcxx.llvm.org/type_<wbr>traits_design.html</a>>`_<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Modified: libcxx/trunk/include/__config<br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=291275&r1=291274&r2=291275&view=diff" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/include/_<wbr>_config?rev=291275&r1=291274&<wbr>r2=291275&view=diff</a><br class="m_-8899661437054950971gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-8899661437054950971gmail_msg">
--- libcxx/trunk/include/__config (original)<br class="m_-8899661437054950971gmail_msg">
+++ libcxx/trunk/include/__config Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
@@ -891,9 +891,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit<br class="m_-8899661437054950971gmail_msg">
 #endif<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 // Thread API<br class="m_-8899661437054950971gmail_msg">
-#if !defined(_LIBCPP_HAS_NO_<wbr>THREADS) && \<br class="m_-8899661437054950971gmail_msg">
-    !defined(_LIBCPP_HAS_THREAD_<wbr>API_PTHREAD) && \<br class="m_-8899661437054950971gmail_msg">
-    !defined(_LIBCPP_HAS_THREAD_<wbr>API_EXTERNAL)<br class="m_-8899661437054950971gmail_msg"></blockquote><div><br></div></div></div><div>This change looks like it breaks existing functionality where if a user defines _LIBCPP_HAS_THREAD_API_PTHREAD they don't need to have any of the detected __FOO__ OS markers below.<br><br>(with this change, even if you say you have pthreads, you still get "No thread API" if you're not on one of those listed OSs)</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+#if !defined(_LIBCPP_HAS_NO_<wbr>THREADS)<br class="m_-8899661437054950971gmail_msg">
 # if defined(__FreeBSD__) || \<br class="m_-8899661437054950971gmail_msg">
     defined(__Fuchsia__) || \<br class="m_-8899661437054950971gmail_msg">
     defined(__NetBSD__) || \<br class="m_-8899661437054950971gmail_msg">
@@ -901,7 +899,9 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit<br class="m_-8899661437054950971gmail_msg">
     defined(__APPLE__) || \<br class="m_-8899661437054950971gmail_msg">
     defined(__CloudABI__) || \<br class="m_-8899661437054950971gmail_msg">
     defined(__sun__)<br class="m_-8899661437054950971gmail_msg">
-#  define _LIBCPP_HAS_THREAD_API_PTHREAD<br class="m_-8899661437054950971gmail_msg">
+#   ifndef _LIBCPP_HAS_THREAD_API_PTHREAD<br class="m_-8899661437054950971gmail_msg">
+#     define _LIBCPP_HAS_THREAD_API_PTHREAD<br class="m_-8899661437054950971gmail_msg">
+#   endif<br class="m_-8899661437054950971gmail_msg">
 # else<br class="m_-8899661437054950971gmail_msg">
 #  error "No thread API"<br class="m_-8899661437054950971gmail_msg">
 # endif // _LIBCPP_HAS_THREAD_API<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Modified: libcxx/trunk/include/__<a href="http://config_site.in" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">config_<wbr>site.in</a><br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config_site.in?rev=291275&r1=291274&r2=291275&view=diff" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/include/_<wbr>_config_site.in?rev=291275&r1=<wbr>291274&r2=291275&view=diff</a><br class="m_-8899661437054950971gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-8899661437054950971gmail_msg">
--- libcxx/trunk/include/__<a href="http://config_site.in" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">config_<wbr>site.in</a> (original)<br class="m_-8899661437054950971gmail_msg">
+++ libcxx/trunk/include/__<a href="http://config_site.in" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">config_<wbr>site.in</a> Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
@@ -21,6 +21,7 @@<br class="m_-8899661437054950971gmail_msg">
 #cmakedefine _LIBCPP_HAS_MUSL_LIBC<br class="m_-8899661437054950971gmail_msg">
 #cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD<br class="m_-8899661437054950971gmail_msg">
 #cmakedefine _LIBCPP_HAS_THREAD_API_<wbr>EXTERNAL<br class="m_-8899661437054950971gmail_msg">
+#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_<wbr>EXTERNAL<br class="m_-8899661437054950971gmail_msg">
 #cmakedefine _LIBCPP_DISABLE_VISIBILITY_<wbr>ANNOTATIONS<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 #endif // _LIBCPP_CONFIG_SITE<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Modified: libcxx/trunk/include/__<wbr>threading_support<br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__threading_support?rev=291275&r1=291274&r2=291275&view=diff" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/include/_<wbr>_threading_support?rev=291275&<wbr>r1=291274&r2=291275&view=diff</a><br class="m_-8899661437054950971gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-8899661437054950971gmail_msg">
--- libcxx/trunk/include/__<wbr>threading_support (original)<br class="m_-8899661437054950971gmail_msg">
+++ libcxx/trunk/include/__<wbr>threading_support Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
@@ -17,39 +17,17 @@<br class="m_-8899661437054950971gmail_msg">
 #pragma GCC system_header<br class="m_-8899661437054950971gmail_msg">
 #endif<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
-#ifndef _LIBCPP_HAS_NO_THREADS<br class="m_-8899661437054950971gmail_msg">
-<br class="m_-8899661437054950971gmail_msg">
-#ifndef __libcpp_has_include<br class="m_-8899661437054950971gmail_msg">
-  #ifndef __has_include<br class="m_-8899661437054950971gmail_msg">
-    #define __libcpp_has_include(x) 0<br class="m_-8899661437054950971gmail_msg">
-  #else<br class="m_-8899661437054950971gmail_msg">
-    #define __libcpp_has_include(x) __has_include(x)<br class="m_-8899661437054950971gmail_msg">
-  #endif<br class="m_-8899661437054950971gmail_msg">
-#endif<br class="m_-8899661437054950971gmail_msg">
-<br class="m_-8899661437054950971gmail_msg">
-#if defined(_LIBCPP_HAS_THREAD_<wbr>API_EXTERNAL) && \<br class="m_-8899661437054950971gmail_msg">
-    !__libcpp_has_include(<__<wbr>external_threading>)<br class="m_-8899661437054950971gmail_msg">
-// If the <__external_threading> header is absent, build libc++ against a<br class="m_-8899661437054950971gmail_msg">
-// pthread-oriented thread api but leave out its implementation. This setup<br class="m_-8899661437054950971gmail_msg">
-// allows building+testing of an externally-threaded library variant (on any<br class="m_-8899661437054950971gmail_msg">
-// platform that supports pthreads). Here, an 'externally-threaded' library<br class="m_-8899661437054950971gmail_msg">
-// variant is one where the implementation of the libc++ thread api is provided<br class="m_-8899661437054950971gmail_msg">
-// as a separate library.<br class="m_-8899661437054950971gmail_msg">
-#define _LIBCPP_HAS_THREAD_API_<wbr>EXTERNAL_PTHREAD<br class="m_-8899661437054950971gmail_msg">
-#endif<br class="m_-8899661437054950971gmail_msg">
-<br class="m_-8899661437054950971gmail_msg">
-#if defined(_LIBCPP_HAS_THREAD_<wbr>API_EXTERNAL) && \<br class="m_-8899661437054950971gmail_msg">
-    __libcpp_has_include(<__<wbr>external_threading>)<br class="m_-8899661437054950971gmail_msg">
-#include <__external_threading><br class="m_-8899661437054950971gmail_msg">
-#else<br class="m_-8899661437054950971gmail_msg">
+#if defined(_LIBCPP_HAS_THREAD_<wbr>API_EXTERNAL)<br class="m_-8899661437054950971gmail_msg">
+# include <__external_threading><br class="m_-8899661437054950971gmail_msg">
+#elif !defined(_LIBCPP_HAS_NO_<wbr>THREADS)<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
-#if defined(_LIBCPP_HAS_THREAD_<wbr>API_PTHREAD) || \<br class="m_-8899661437054950971gmail_msg">
-    defined(_LIBCPP_HAS_THREAD_<wbr>API_EXTERNAL_PTHREAD)<br class="m_-8899661437054950971gmail_msg">
-#include <pthread.h><br class="m_-8899661437054950971gmail_msg">
-#include <sched.h><br class="m_-8899661437054950971gmail_msg">
+#if defined(_LIBCPP_HAS_THREAD_<wbr>API_PTHREAD)<br class="m_-8899661437054950971gmail_msg">
+# include <pthread.h><br class="m_-8899661437054950971gmail_msg">
+# include <sched.h><br class="m_-8899661437054950971gmail_msg">
 #endif<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
-#if defined(_LIBCPP_HAS_THREAD_<wbr>API_EXTERNAL)<br class="m_-8899661437054950971gmail_msg">
+#if defined(_LIBCPP_HAS_THREAD_<wbr>LIBRARY_EXTERNAL) || \<br class="m_-8899661437054950971gmail_msg">
+    defined(_LIBCPP_BUILDING_<wbr>THREAD_LIBRARY_EXTERNAL)<br class="m_-8899661437054950971gmail_msg">
 #define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS<br class="m_-8899661437054950971gmail_msg">
 #else<br class="m_-8899661437054950971gmail_msg">
 #define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY<br class="m_-8899661437054950971gmail_msg">
@@ -57,8 +35,7 @@<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 _LIBCPP_BEGIN_NAMESPACE_STD<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
-#if defined(_LIBCPP_HAS_THREAD_<wbr>API_PTHREAD) || \<br class="m_-8899661437054950971gmail_msg">
-    defined(_LIBCPP_HAS_THREAD_<wbr>API_EXTERNAL_PTHREAD)<br class="m_-8899661437054950971gmail_msg">
+#if defined(_LIBCPP_HAS_THREAD_<wbr>API_PTHREAD)<br class="m_-8899661437054950971gmail_msg">
 // Mutex<br class="m_-8899661437054950971gmail_msg">
 typedef pthread_mutex_t __libcpp_mutex_t;<br class="m_-8899661437054950971gmail_msg">
 #define _LIBCPP_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER<br class="m_-8899661437054950971gmail_msg">
@@ -175,8 +152,10 @@ void *__libcpp_tls_get(__libcpp_<wbr>tls_key<br class="m_-8899661437054950971gmail_msg">
 _LIBCPP_THREAD_ABI_VISIBILITY<br class="m_-8899661437054950971gmail_msg">
 int __libcpp_tls_set(__libcpp_tls_<wbr>key __key, void *__p);<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
-#if defined(_LIBCPP_HAS_THREAD_<wbr>API_PTHREAD) || \<br class="m_-8899661437054950971gmail_msg">
-    defined(_LIBCPP_BUILDING_<wbr>THREAD_API_EXTERNAL_PTHREAD)<br class="m_-8899661437054950971gmail_msg">
+#if !defined(_LIBCPP_HAS_THREAD_<wbr>LIBRARY_EXTERNAL) || \<br class="m_-8899661437054950971gmail_msg">
+    defined(_LIBCPP_BUILDING_<wbr>THREAD_LIBRARY_EXTERNAL)<br class="m_-8899661437054950971gmail_msg">
+<br class="m_-8899661437054950971gmail_msg">
+#if defined(_LIBCPP_HAS_THREAD_<wbr>API_PTHREAD)<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 int __libcpp_recursive_mutex_init(<wbr>__libcpp_recursive_mutex_t *__m)<br class="m_-8899661437054950971gmail_msg">
 {<br class="m_-8899661437054950971gmail_msg">
@@ -344,10 +323,10 @@ int __libcpp_tls_set(__libcpp_tls_<wbr>key __<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 #endif // _LIBCPP_HAS_THREAD_API_PTHREAD<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
-_LIBCPP_END_NAMESPACE_STD<br class="m_-8899661437054950971gmail_msg">
+#endif // !_LIBCPP_HAS_THREAD_LIBRARY_<wbr>EXTERNAL || _LIBCPP_BUILDING_THREAD_<wbr>LIBRARY_EXTERNAL<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
-#endif // !_LIBCPP_HAS_THREAD_API_<wbr>EXTERNAL || !__libcpp_has_include(<__<wbr>external_threading>)<br class="m_-8899661437054950971gmail_msg">
+_LIBCPP_END_NAMESPACE_STD<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
-#endif // _LIBCPP_HAS_NO_THREADS<br class="m_-8899661437054950971gmail_msg">
+#endif // !_LIBCPP_HAS_NO_THREADS<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 #endif // _LIBCPP_THREADING_SUPPORT<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Modified: libcxx/trunk/lib/CMakeLists.<wbr>txt<br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=291275&r1=291274&r2=291275&view=diff" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/lib/<wbr>CMakeLists.txt?rev=291275&r1=<wbr>291274&r2=291275&view=diff</a><br class="m_-8899661437054950971gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-8899661437054950971gmail_msg">
--- libcxx/trunk/lib/CMakeLists.<wbr>txt (original)<br class="m_-8899661437054950971gmail_msg">
+++ libcxx/trunk/lib/CMakeLists.<wbr>txt Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
@@ -275,7 +275,7 @@ if (LIBCXX_ENABLE_EXPERIMENTAL_<wbr>LIBRARY)<br class="m_-8899661437054950971gmail_msg">
   )<br class="m_-8899661437054950971gmail_msg">
 endif()<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
-if (LIBCXX_HAS_EXTERNAL_THREAD_<wbr>API)<br class="m_-8899661437054950971gmail_msg">
+if (LIBCXX_BUILD_EXTERNAL_THREAD_<wbr>LIBRARY)<br class="m_-8899661437054950971gmail_msg">
   file(GLOB LIBCXX_EXTERNAL_THREADING_<wbr>SUPPORT_SOURCES ../test/support/external_<wbr>threads.cpp)<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
   if (LIBCXX_ENABLE_SHARED)<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Modified: libcxx/trunk/test/CMakeLists.<wbr>txt<br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/CMakeLists.txt?rev=291275&r1=291274&r2=291275&view=diff" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/test/<wbr>CMakeLists.txt?rev=291275&r1=<wbr>291274&r2=291275&view=diff</a><br class="m_-8899661437054950971gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-8899661437054950971gmail_msg">
--- libcxx/trunk/test/CMakeLists.<wbr>txt (original)<br class="m_-8899661437054950971gmail_msg">
+++ libcxx/trunk/test/CMakeLists.<wbr>txt Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
@@ -34,7 +34,7 @@ pythonize_bool(LIBCXXABI_<wbr>ENABLE_SHARED)<br class="m_-8899661437054950971gmail_msg">
 pythonize_bool(LIBCXXABI_USE_<wbr>LLVM_UNWINDER)<br class="m_-8899661437054950971gmail_msg">
 pythonize_bool(LIBCXX_HAS_<wbr>ATOMIC_LIB)<br class="m_-8899661437054950971gmail_msg">
 pythonize_bool(LIBCXX_HAVE_<wbr>CXX_ATOMICS_WITH_LIB)<br class="m_-8899661437054950971gmail_msg">
-pythonize_bool(LIBCXX_HAS_<wbr>EXTERNAL_THREAD_API)<br class="m_-8899661437054950971gmail_msg">
+pythonize_bool(LIBCXX_BUILD_<wbr>EXTERNAL_THREAD_LIBRARY)<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 # By default, for non-standalone builds, libcxx and libcxxabi share a library<br class="m_-8899661437054950971gmail_msg">
 # directory.<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Modified: libcxx/trunk/test/<a href="http://lit.site.cfg.in" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">lit.site.<wbr>cfg.in</a><br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.site.cfg.in?rev=291275&r1=291274&r2=291275&view=diff" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/test/lit.<wbr>site.cfg.in?rev=291275&r1=<wbr>291274&r2=291275&view=diff</a><br class="m_-8899661437054950971gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-8899661437054950971gmail_msg">
--- libcxx/trunk/test/<a href="http://lit.site.cfg.in" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">lit.site.<wbr>cfg.in</a> (original)<br class="m_-8899661437054950971gmail_msg">
+++ libcxx/trunk/test/<a href="http://lit.site.cfg.in" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">lit.site.<wbr>cfg.in</a> Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
@@ -28,7 +28,7 @@ config.has_libatomic            = "@LIBC<br class="m_-8899661437054950971gmail_msg">
 config.use_libatomic            = "@LIBCXX_HAVE_CXX_ATOMICS_<wbr>WITH_LIB@"<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 config.libcxxabi_shared         = "@LIBCXXABI_ENABLE_SHARED@"<br class="m_-8899661437054950971gmail_msg">
-config.cxx_ext_threads          = "@LIBCXX_HAS_EXTERNAL_THREAD_<wbr>API@"<br class="m_-8899661437054950971gmail_msg">
+config.cxx_ext_threads          = "@LIBCXX_BUILD_EXTERNAL_<wbr>THREAD_LIBRARY@"<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
 # Let the main config do the real work.<br class="m_-8899661437054950971gmail_msg">
 config.loaded_site_config = True<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
Modified: libcxx/trunk/test/support/<wbr>external_threads.cpp<br class="m_-8899661437054950971gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/external_threads.cpp?rev=291275&r1=291274&r2=291275&view=diff" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxx/trunk/test/<wbr>support/external_threads.cpp?<wbr>rev=291275&r1=291274&r2=<wbr>291275&view=diff</a><br class="m_-8899661437054950971gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-8899661437054950971gmail_msg">
--- libcxx/trunk/test/support/<wbr>external_threads.cpp (original)<br class="m_-8899661437054950971gmail_msg">
+++ libcxx/trunk/test/support/<wbr>external_threads.cpp Fri Jan  6 14:05:40 2017<br class="m_-8899661437054950971gmail_msg">
@@ -6,5 +6,5 @@<br class="m_-8899661437054950971gmail_msg">
 // Source Licenses. See LICENSE.TXT for details.<br class="m_-8899661437054950971gmail_msg">
 //<br class="m_-8899661437054950971gmail_msg">
 //===------------------------<wbr>------------------------------<wbr>----------------===//<br class="m_-8899661437054950971gmail_msg">
-#define _LIBCPP_BUILDING_THREAD_API_<wbr>EXTERNAL_PTHREAD<br class="m_-8899661437054950971gmail_msg">
+#define _LIBCPP_BUILDING_THREAD_<wbr>LIBRARY_EXTERNAL<br class="m_-8899661437054950971gmail_msg">
 #include <__threading_support><br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
<br class="m_-8899661437054950971gmail_msg">
______________________________<wbr>_________________<br class="m_-8899661437054950971gmail_msg">
cfe-commits mailing list<br class="m_-8899661437054950971gmail_msg">
<a href="mailto:cfe-commits@lists.llvm.org" class="m_-8899661437054950971gmail_msg" target="_blank">cfe-commits@lists.llvm.org</a><br class="m_-8899661437054950971gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" class="m_-8899661437054950971gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br class="m_-8899661437054950971gmail_msg">
</blockquote></div></div></div></div>
</blockquote></div><br></div>