Skip to content

Commit

Permalink
Disable the use of std::call_once on OpenBSD with libstdc++.
Browse files Browse the repository at this point in the history
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285782 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
brad0 committed Nov 2, 2016
1 parent 465b55b commit c17dedb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/llvm/Support/Threading.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c17dedb

Please sign in to comment.