From 40712df9ab3d91bae3da5b9a9e8d89983f875fed Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 16 Aug 2019 13:54:23 -0700 Subject: [PATCH] ThreadPoolImpl::Impl::BGThreadWrapper() returns void (#5709) Summary: there is no need to return void*, as std::thread::thread(Func&& f, Args&&... args ) only requires `Func` to be callable. Signed-off-by: Kefu Chai Pull Request resolved: https://github.com/facebook/rocksdb/pull/5709 Differential Revision: D16832894 fbshipit-source-id: a1e1b876fa8d55589ef5feb5b27f3a435068b747 --- util/threadpool_imp.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/threadpool_imp.cc b/util/threadpool_imp.cc index ea5e875df..1a597e248 100644 --- a/util/threadpool_imp.cc +++ b/util/threadpool_imp.cc @@ -99,7 +99,7 @@ struct ThreadPoolImpl::Impl { private: - static void* BGThreadWrapper(void* arg); + static void BGThreadWrapper(void* arg); bool low_io_priority_; bool low_cpu_priority_; @@ -275,7 +275,7 @@ struct BGThreadMetadata { : thread_pool_(thread_pool), thread_id_(thread_id) {} }; -void* ThreadPoolImpl::Impl::BGThreadWrapper(void* arg) { +void ThreadPoolImpl::Impl::BGThreadWrapper(void* arg) { BGThreadMetadata* meta = reinterpret_cast(arg); size_t thread_id = meta->thread_id_; ThreadPoolImpl::Impl* tp = meta->thread_pool_; @@ -298,7 +298,7 @@ void* ThreadPoolImpl::Impl::BGThreadWrapper(void* arg) { break; case Env::Priority::TOTAL: assert(false); - return nullptr; + return; } assert(thread_type != ThreadStatus::NUM_THREAD_TYPES); ThreadStatusUtil::RegisterThread(tp->GetHostEnv(), thread_type); @@ -308,7 +308,7 @@ void* ThreadPoolImpl::Impl::BGThreadWrapper(void* arg) { #ifdef ROCKSDB_USING_THREAD_STATUS ThreadStatusUtil::UnregisterThread(); #endif - return nullptr; + return; } void ThreadPoolImpl::Impl::SetBackgroundThreadsInternal(int num,