summaryrefslogtreecommitdiff
path: root/lib/Support/Windows
diff options
context:
space:
mode:
authorFilip Pizlo <fpizlo@apple.com>2013-09-18 16:40:14 +0000
committerFilip Pizlo <fpizlo@apple.com>2013-09-18 16:40:14 +0000
commitb4b9b3b24c03f414c54f55e1b34b4d9124c55883 (patch)
tree52a8d39236094cd7c8dc7dd94772c76ddde530fa /lib/Support/Windows
parent69f99bf3a391c3fa1b6e49d963dbb914790b428c (diff)
downloadllvm-b4b9b3b24c03f414c54f55e1b34b4d9124c55883.tar.gz
llvm-b4b9b3b24c03f414c54f55e1b34b4d9124c55883.tar.bz2
llvm-b4b9b3b24c03f414c54f55e1b34b4d9124c55883.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows')
-rw-r--r--lib/Support/Windows/DynamicLibrary.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Support/Windows/DynamicLibrary.inc b/lib/Support/Windows/DynamicLibrary.inc
index 83da82a949..2edaf74fa5 100644
--- a/lib/Support/Windows/DynamicLibrary.inc
+++ b/lib/Support/Windows/DynamicLibrary.inc
@@ -71,7 +71,7 @@ extern "C" {
DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename,
std::string *errMsg) {
- SmartScopedLock<true> lock(getMutex());
+ SmartScopedLock<true> 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<true> Lock(getMutex());
+ SmartScopedLock<true> Lock(*SymbolsMutex);
// First check symbols added via AddSymbol().
- if (ExplicitSymbols) {
+ if (ExplicitSymbols.isConstructed()) {
StringMap<void *>::iterator i = ExplicitSymbols->find(symbolName);
if (i != ExplicitSymbols->end())