mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-30 17:10:40 +08:00
fix possible deadlock when using internal synchronization
This commit is contained in:
Vendored
+1
-2
@@ -2578,8 +2578,7 @@ protected:
|
||||
{
|
||||
bool operator==(const Inner& o) const
|
||||
{
|
||||
MutexLock_ m1(const_cast<Inner *>(this));
|
||||
MutexLock_ m2(const_cast<Inner *>(&o)); // deadlock - use std::lock
|
||||
phmap::scoped_lock<Mutex> l(const_cast<Inner &>(*this), const_cast<Inner &>(o));
|
||||
return set_ == o.set_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user