diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-14 23:44:21 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-14 23:44:21 +0000 |
commit | 0fb24887026f9314a49f1ebd6ff6ed5352279913 (patch) | |
tree | e80df19c6a511d8e00d1f669b332a6ac2e8227b5 /llvm/lib/Support/Windows | |
parent | 0b89ade3411e74c30de7a7cab92d417415ff6db6 (diff) | |
download | bcm5719-llvm-0fb24887026f9314a49f1ebd6ff6ed5352279913.tar.gz bcm5719-llvm-0fb24887026f9314a49f1ebd6ff6ed5352279913.zip |
Revert "Revert "Revert 220932.": "Removing the static initializer in ManagedStatic.cpp by using llvm_call_once to initialize the ManagedStatic mutex""
This reverts commit r269577.
Broke NetBSD, waiting for Kamil to investigate
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 269584
Diffstat (limited to 'llvm/lib/Support/Windows')
-rw-r--r-- | llvm/lib/Support/Windows/Threading.inc | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/llvm/lib/Support/Windows/Threading.inc b/llvm/lib/Support/Windows/Threading.inc deleted file mode 100644 index 196be890dbf..00000000000 --- a/llvm/lib/Support/Windows/Threading.inc +++ /dev/null @@ -1,24 +0,0 @@ - #include <windows.h> - -#ifdef MemoryFence -// WinNT.h seems to define a MemoryFence macro. -#undef MemoryFence -#endif - -void llvm::call_once(once_flag &flag, void (*fptr)(void)) { - while (flag != Done) { - if (flag == Wait) { - ::Sleep(1); - continue; - } - - sys::cas_flag old_val = sys::CompareAndSwap(&flag, Wait, Uninitialized); - if (old_val == Uninitialized) { - fptr(); - sys::MemoryFence(); - flag = Done; - return; - } - } - sys::MemoryFence(); -} |