HashMap: Fix the build with GCC 7.

This commit is contained in:
Augustin Cavalier
2019-02-14 19:52:45 -05:00
parent b6840f3610
commit fc8e5be1c8
2 changed files with 10 additions and 3 deletions
+9 -1
View File
@@ -163,7 +163,7 @@ public:
typedef typename HashMap<Key, Value>::Iterator Iterator;
SynchronizedHashMap() : Locker("synchronized hash map") {}
~SynchronizedHashMap() { Lock(); }
~SynchronizedHashMap() { Locker::Lock(); }
status_t InitCheck() const
{
@@ -186,6 +186,14 @@ public:
return fMap.Remove(key);
}
Value Remove(Iterator& it)
{
MapLocker locker(this);
if (!locker.IsLocked())
return Value();
return fMap.Remove(it);
}
void Clear()
{
MapLocker locker(this);