From bf5b5c1bf43946039d91f78253599c9996f86057 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 1 Apr 2021 01:05:45 -0300 Subject: common/thread_worker: Use unique function --- src/common/thread_worker.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/common/thread_worker.h') diff --git a/src/common/thread_worker.h b/src/common/thread_worker.h index 7a6756eb5..7e2b04a07 100644 --- a/src/common/thread_worker.h +++ b/src/common/thread_worker.h @@ -11,18 +11,20 @@ #include #include +#include "common/unique_function.h" + namespace Common { class ThreadWorker final { public: explicit ThreadWorker(std::size_t num_workers, const std::string& name); ~ThreadWorker(); - void QueueWork(std::function&& work); + void QueueWork(UniqueFunction work); void WaitForRequests(); private: std::vector threads; - std::queue> requests; + std::queue> requests; std::mutex queue_mutex; std::condition_variable condition; std::condition_variable wait_condition; -- cgit v1.2.3