[llvm] r285782 - Disable the use of std::call_once on OpenBSD with libstdc++.

Brad Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 18:39:02 PDT 2016


Author: brad
Date: Tue Nov  1 20:39:01 2016
New Revision: 285782

URL: http://llvm.org/viewvc/llvm-project?rev=285782&view=rev
Log:
Disable the use of std::call_once on OpenBSD with libstdc++.

It was noticed this caused performance regressions and deadlocks. PR30768.

Reorder the code to make it clearer what is tested.

PPC now disables the use of std::call_once only with libstdc++ with
the reordering of the code, as was the original intent.

Modified:
    llvm/trunk/include/llvm/Support/Threading.h

Modified: llvm/trunk/include/llvm/Support/Threading.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Threading.h?rev=285782&r1=285781&r2=285782&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Threading.h (original)
+++ llvm/trunk/include/llvm/Support/Threading.h Tue Nov  1 20:39:01 2016
@@ -20,11 +20,11 @@
 #include <ciso646> // So we can check the C++ standard lib macros.
 #include <functional>
 
-// We use std::call_once on all Unix platforms except for NetBSD with
-// libstdc++. That platform has a bug they are working to fix, and they'll
-// remove the NetBSD checks once fixed.
-#if defined(LLVM_ON_UNIX) &&                                                   \
-    !(defined(__NetBSD__) && !defined(_LIBCPP_VERSION)) && !defined(__ppc__)
+// std::call_once from libc++ is used on all Unix platforms. Other
+// implementations like libstdc++ are known to have problems on NetBSD,
+// OpenBSD and PowerPC.
+#if defined(LLVM_ON_UNIX) && (defined(_LIBCPP_VERSION) ||                      \
+    !(defined(__NetBSD__) || defined(__OpenBSD__) || defined(__ppc__)))
 #define LLVM_THREADING_USE_STD_CALL_ONCE 1
 #else
 #define LLVM_THREADING_USE_STD_CALL_ONCE 0




More information about the llvm-commits mailing list