From: Yaron Keren Date: Tue, 19 May 2015 13:31:25 +0000 (+0000) Subject: Prevent Cleanup() from running more than once. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=add5ea661a315b1c6833cc1f3c7966ab74046e7f;p=oota-llvm.git Prevent Cleanup() from running more than once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237694 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/Windows/Signals.inc b/lib/Support/Windows/Signals.inc index d81d3c8b90b..26c3c6e111a 100644 --- a/lib/Support/Windows/Signals.inc +++ b/lib/Support/Windows/Signals.inc @@ -441,6 +441,9 @@ void llvm::sys::AddSignalHandler(void (*FnPtr)(void *), void *Cookie) { } static void Cleanup() { + if (CleanupExecuted) + return; + EnterCriticalSection(&CriticalSection); // Prevent other thread from registering new files and directories for