ThreadPoolImpl::Impl::BGThreadWrapper() returns void (#5709)
Summary: there is no need to return void*, as std:🧵:thread(Func&& f, Args&&... args ) only requires `Func` to be callable. Signed-off-by: Kefu Chai <tchaikov@gmail.com> Pull Request resolved: https://github.com/facebook/rocksdb/pull/5709 Differential Revision: D16832894 fbshipit-source-id: a1e1b876fa8d55589ef5feb5b27f3a435068b747
This commit is contained in:
parent
3a3dc29437
commit
40712df9ab
@ -99,7 +99,7 @@ struct ThreadPoolImpl::Impl {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static void* BGThreadWrapper(void* arg);
|
static void BGThreadWrapper(void* arg);
|
||||||
|
|
||||||
bool low_io_priority_;
|
bool low_io_priority_;
|
||||||
bool low_cpu_priority_;
|
bool low_cpu_priority_;
|
||||||
@ -275,7 +275,7 @@ struct BGThreadMetadata {
|
|||||||
: thread_pool_(thread_pool), thread_id_(thread_id) {}
|
: thread_pool_(thread_pool), thread_id_(thread_id) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
void* ThreadPoolImpl::Impl::BGThreadWrapper(void* arg) {
|
void ThreadPoolImpl::Impl::BGThreadWrapper(void* arg) {
|
||||||
BGThreadMetadata* meta = reinterpret_cast<BGThreadMetadata*>(arg);
|
BGThreadMetadata* meta = reinterpret_cast<BGThreadMetadata*>(arg);
|
||||||
size_t thread_id = meta->thread_id_;
|
size_t thread_id = meta->thread_id_;
|
||||||
ThreadPoolImpl::Impl* tp = meta->thread_pool_;
|
ThreadPoolImpl::Impl* tp = meta->thread_pool_;
|
||||||
@ -298,7 +298,7 @@ void* ThreadPoolImpl::Impl::BGThreadWrapper(void* arg) {
|
|||||||
break;
|
break;
|
||||||
case Env::Priority::TOTAL:
|
case Env::Priority::TOTAL:
|
||||||
assert(false);
|
assert(false);
|
||||||
return nullptr;
|
return;
|
||||||
}
|
}
|
||||||
assert(thread_type != ThreadStatus::NUM_THREAD_TYPES);
|
assert(thread_type != ThreadStatus::NUM_THREAD_TYPES);
|
||||||
ThreadStatusUtil::RegisterThread(tp->GetHostEnv(), thread_type);
|
ThreadStatusUtil::RegisterThread(tp->GetHostEnv(), thread_type);
|
||||||
@ -308,7 +308,7 @@ void* ThreadPoolImpl::Impl::BGThreadWrapper(void* arg) {
|
|||||||
#ifdef ROCKSDB_USING_THREAD_STATUS
|
#ifdef ROCKSDB_USING_THREAD_STATUS
|
||||||
ThreadStatusUtil::UnregisterThread();
|
ThreadStatusUtil::UnregisterThread();
|
||||||
#endif
|
#endif
|
||||||
return nullptr;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThreadPoolImpl::Impl::SetBackgroundThreadsInternal(int num,
|
void ThreadPoolImpl::Impl::SetBackgroundThreadsInternal(int num,
|
||||||
|
Loading…
Reference in New Issue
Block a user