[libcxx-commits] [PATCH] D64298: Make ~mutex and ~condition_variable trivial with Apple pthreads
Eric Fiselier via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jul 7 10:48:36 PDT 2019
EricWF updated this revision to Diff 208298.
EricWF retitled this revision from "Make ~mutex trivial with Apple pthreads" to "Make ~mutex and ~condition_variable trivial with Apple pthreads".
EricWF set the repository for this revision to rCXX libc++.
EricWF added a subscriber: libcxx-commits.
Repository:
rCXX libc++
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64298/new/
https://reviews.llvm.org/D64298
Files:
include/__config
Index: include/__config
===================================================================
--- include/__config
+++ include/__config
@@ -1100,17 +1100,20 @@
// The Apple, glibc, and Bionic implementation of pthreads implements
// pthread_mutex_destroy as nop for regular mutexes. Additionally, Win32
// mutexes have no destroy mechanism.
-// TODO(EricWF): Enable this optimization on Apple and Bionic platforms after
+// TODO(EricWF): Enable this optimization on Bionic platforms after
// speaking to their respective stakeholders.
-#if (defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && defined(__GLIBC__)) \
+#if (defined(_LIBCPP_HAS_THREAD_API_PTHREAD) \
+ && (defined(__GLIBC__) || defined(__APPLE__))) \
|| defined(_LIBCPP_HAS_THREAD_API_WIN32)
# define _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION
#endif
-// Destroying a condvar is a nop on Windows.
+// Destroying a condvar is a nop on Windows and with certain pthread
+// implementations.
// TODO(EricWF): This is potentially true for some pthread implementations
// as well.
-#if defined(_LIBCPP_HAS_THREAD_API_WIN32)
+#if (defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && defined(__APPLE__)) \
+ || defined(_LIBCPP_HAS_THREAD_API_WIN32)
# define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
#endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64298.208298.patch
Type: text/x-patch
Size: 1257 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190707/82a9f238/attachment.bin>
More information about the libcxx-commits
mailing list