Support: make LLVM Mutexes STL-compatible

Use lock/unlock() convention instead of acquire/release().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216336 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dylan Noblesmith
2014-08-23 22:49:22 +00:00
parent 7e3e4311c5
commit d930a30833
7 changed files with 42 additions and 40 deletions

View File

@ -111,7 +111,7 @@ public:
void clear() { Map.clear(); }
/// Return 1 if the specified key is in the map, 0 otherwise.
/// Return 1 if the specified key is in the map, 0 otherwise.
size_type count(const KeyT &Val) const {
return Map.find_as(Val) == Map.end() ? 0 : 1;
}
@ -217,11 +217,11 @@ public:
ValueMapCallbackVH Copy(*this);
typename Config::mutex_type *M = Config::getMutex(Copy.Map->Data);
if (M)
M->acquire();
M->lock();
Config::onDelete(Copy.Map->Data, Copy.Unwrap()); // May destroy *this.
Copy.Map->Map.erase(Copy); // Definitely destroys *this.
if (M)
M->release();
M->unlock();
}
void allUsesReplacedWith(Value *new_key) override {
assert(isa<KeySansPointerT>(new_key) &&
@ -230,7 +230,7 @@ public:
ValueMapCallbackVH Copy(*this);
typename Config::mutex_type *M = Config::getMutex(Copy.Map->Data);
if (M)
M->acquire();
M->lock();
KeyT typed_new_key = cast<KeySansPointerT>(new_key);
// Can destroy *this:
@ -246,7 +246,7 @@ public:
}
}
if (M)
M->release();
M->unlock();
}
};