mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
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:
@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user