diff --git a/bolt/runtime/instr.cpp b/bolt/runtime/instr.cpp --- a/bolt/runtime/instr.cpp +++ b/bolt/runtime/instr.cpp @@ -289,6 +289,7 @@ /// Traverses all elements in the table template void forEachElement(void (*Callback)(MapEntry &, Args...), Args... args) { + Lock L(M); if (!TableRoot) return; return forEachElement(Callback, InitialSize, TableRoot, args...); @@ -378,7 +379,6 @@ template void SimpleHashTable::resetCounters() { - Lock L(M); forEachElement(resetIndCallCounter); }