From 57093e88e013efeac744af18dc9deda113dd1417 Mon Sep 17 00:00:00 2001 From: Filip Pizlo Date: Wed, 18 Sep 2013 16:40:14 +0000 Subject: Make DynamicLibrary use ManagedStatic. This is pretty simple and should just work as advertised - but it does have the caveat that calls to DynamicLibrary::AddSymbol will "reset" if you shutdown llvm and try to come back for seconds. This is a subtle behavior change, but I'm assuming that nobody is affected by it. llvm-svn: 190946 --- llvm/lib/Support/Windows/DynamicLibrary.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Support/Windows/DynamicLibrary.inc') diff --git a/llvm/lib/Support/Windows/DynamicLibrary.inc b/llvm/lib/Support/Windows/DynamicLibrary.inc index 83da82a949c..2edaf74fa56 100644 --- a/llvm/lib/Support/Windows/DynamicLibrary.inc +++ b/llvm/lib/Support/Windows/DynamicLibrary.inc @@ -71,7 +71,7 @@ extern "C" { DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename, std::string *errMsg) { - SmartScopedLock lock(getMutex()); + SmartScopedLock lock(*SymbolsMutex); if (!filename) { // When no file is specified, enumerate all DLLs and EXEs in the process. @@ -114,10 +114,10 @@ DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename, #undef EXPLICIT_SYMBOL2 void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) { - SmartScopedLock Lock(getMutex()); + SmartScopedLock Lock(*SymbolsMutex); // First check symbols added via AddSymbol(). - if (ExplicitSymbols) { + if (ExplicitSymbols.isConstructed()) { StringMap::iterator i = ExplicitSymbols->find(symbolName); if (i != ExplicitSymbols->end()) -- cgit v1.2.3