diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-14 20:55:52 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-14 20:55:52 +0000 |
commit | c048b6c4cd1025ae8144ea77b3ed7c43edb1c153 (patch) | |
tree | 1d57b8bcc51d306038d80549aa2b9a03d762064d /llvm/lib/Support/Unix | |
parent | 23a66e45ed7b8b6b6759b3b8b0dea32e9b481ee8 (diff) | |
download | bcm5719-llvm-c048b6c4cd1025ae8144ea77b3ed7c43edb1c153.tar.gz bcm5719-llvm-c048b6c4cd1025ae8144ea77b3ed7c43edb1c153.zip |
Revert "Revert 220932.": "Removing the static initializer in ManagedStatic.cpp by using llvm_call_once to initialize the ManagedStatic mutex"
This reverts commit r221331 and reinstate r220932 as discussed in D19271.
Original commit message was:
This patch adds an llvm_call_once which is a wrapper around
std::call_once on platforms where it is available and devoid
of bugs. The patch also migrates the ManagedStatic mutex to
be allocated using llvm_call_once.
These changes are philosophically equivalent to the changes
added in r219638, which were reverted due to a hang on Win32
which was the result of a bug in the Windows implementation
of std::call_once.
Differential Revision: http://reviews.llvm.org/D5922
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 269577
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/Threading.inc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc new file mode 100644 index 00000000000..35ec876904a --- /dev/null +++ b/llvm/lib/Support/Unix/Threading.inc @@ -0,0 +1,5 @@ +#include <thread> + +void llvm::call_once(once_flag& flag, void (*fptr)(void)) { + std::call_once(flag, fptr); +} |