[PATCH] D21968: [libcxx] Externally threaded libc++ variant - Take 2
Asiri Rathnayake via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 22 09:08:42 PDT 2016
rmaprath added inline comments.
================
Comment at: include/__external_threading:26
@@ +25,3 @@
+
+#if !defined(_LIBCPP_MUTEX_T) || \
+ !defined(_LIBCPP_MUTEX_INITIALIZER) || \
----------------
mclow.lists wrote:
> bcraig wrote:
> > So users of external pthreading (or their compiler driver) would need to provide a pile of -D options on the command line? Or is it expected that users will have their own __external_threading header that comes earlier in the include path? Please document your expectation.
> My expectation is that system vendors who have a different threading implementation will ship a customized version of the libc++ headers and dylib.
>
> The headers will include a replacement `include/__external_threading`, and a modified `include/__config` that contains additional `#define`s
>
> What this patch does is to provide a customization point to produce such libraries.
>
This is correct.
With the latest revision, I (following @bcraig's comments) have made this a bit more simpler; system vendors can simply drop in the header `include/__external_threading` to override the default threading implementation. When this header is provided (and `_LIBCPP_HAS_THREAD_API_EXTERNAL` is defined - which is automatically wired into `__config` header through `__config_site.in` at build time), the built library will end up using the new threading implementation.
https://reviews.llvm.org/D21968
More information about the cfe-commits
mailing list