From 0fb24887026f9314a49f1ebd6ff6ed5352279913 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 14 May 2016 23:44:21 +0000 Subject: 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 llvm-svn: 269584 --- llvm/lib/Support/Windows/Threading.inc | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 llvm/lib/Support/Windows/Threading.inc (limited to 'llvm/lib/Support/Windows') 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 - -#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(); -} -- cgit v1.2.3