From 6493bd35f6e50048132d0efd910b4661f25c317c Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 7 Apr 2019 09:14:37 -0400 Subject: [PATCH] fix possible deadlock when using internal synchronization --- parallel_hashmap/phmap.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index b41403c..5281eb4 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -2578,8 +2578,7 @@ protected: { bool operator==(const Inner& o) const { - MutexLock_ m1(const_cast(this)); - MutexLock_ m2(const_cast(&o)); // deadlock - use std::lock + phmap::scoped_lock l(const_cast(*this), const_cast(o)); return set_ == o.set_; }