diff --git a/src/storage/garbage_collector.hpp b/src/storage/garbage_collector.hpp index ed7420b2e..36a8fed41 100644 --- a/src/storage/garbage_collector.hpp +++ b/src/storage/garbage_collector.hpp @@ -27,7 +27,10 @@ class GarbageCollector : public Loggable { ~GarbageCollector() { destruction_.store(true); - condition_variable_.notify_one(); + { + std::unique_lock lk(mutex_); + condition_variable_.notify_one(); + } if (run_thread_.joinable()) run_thread_.join(); }