From 2389aa2da9856de6a364b47505df5cd76dc55373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E?= Date: Wed, 18 Sep 2019 14:23:40 -0700 Subject: [PATCH] Remove unneeded unlock statement (#5809) Summary: The dtor will automatically do unlock Pull Request resolved: https://github.com/facebook/rocksdb/pull/5809 Differential Revision: D17453694 Pulled By: ltamasi fbshipit-source-id: 5348bff8e6a620a05ff639a5454e8d82ae98a22d --- util/threadpool_imp.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/threadpool_imp.cc b/util/threadpool_imp.cc index 1a597e248..2e71f223f 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_ ||