diff --git a/util/threadpool_imp.cc b/util/threadpool_imp.cc index 1a597e2482..2e71f223f4 100644 --- a/util/threadpool_imp.cc +++ b/util/threadpool_imp.cc @@ -313,9 +313,8 @@ void ThreadPoolImpl::Impl::BGThreadWrapper(void* arg) { void ThreadPoolImpl::Impl::SetBackgroundThreadsInternal(int num, bool allow_reduce) { - std::unique_lock lock(mu_); + std::lock_guard lock(mu_); if (exit_all_threads_) { - lock.unlock(); return; } if (num > total_threads_limit_ ||