|
@@ -1098,13 +1098,22 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
|
|
#endif
|
|
#endif
|
|
|
|
|
|
// The Apple, glibc, and Bionic implementation of pthreads implements
|
|
// The Apple, glibc, and Bionic implementation of pthreads implements
|
|
-// pthread_mutex_destroy as nop for regular mutexes.
|
|
|
|
|
|
+// 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 Apple and Bionic platforms after
|
|
// speaking to their respective stakeholders.
|
|
// speaking to their respective stakeholders.
|
|
-#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && defined(__GLIBC__)
|
|
|
|
|
|
+#if (defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && defined(__GLIBC__)) \
|
|
|
|
+ || defined(_LIBCPP_HAS_THREAD_API_WIN32)
|
|
# define _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION
|
|
# define _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+// Destroying a condvar is a nop on Windows.
|
|
|
|
+// TODO(EricWF): This is potentially true for some pthread implementations
|
|
|
|
+// as well.
|
|
|
|
+#if defined(_LIBCPP_HAS_THREAD_API_WIN32)
|
|
|
|
+# define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
|
|
|
|
+#endif
|
|
|
|
+
|
|
// Systems that use capability-based security (FreeBSD with Capsicum,
|
|
// Systems that use capability-based security (FreeBSD with Capsicum,
|
|
// Nuxi CloudABI) may only provide local filesystem access (using *at()).
|
|
// Nuxi CloudABI) may only provide local filesystem access (using *at()).
|
|
// Functions like open(), rename(), unlink() and stat() should not be
|
|
// Functions like open(), rename(), unlink() and stat() should not be
|