summaryrefslogtreecommitdiffstats
path: root/src/common/thread_worker.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-04-01 06:05:45 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2021-07-09 00:03:26 +0200
commitbf5b5c1bf43946039d91f78253599c9996f86057 (patch)
tree2fcfd8f48297b03e3a9eb03cfe7594c7ead4edaa /src/common/thread_worker.h
parentcommon: Add unique function (diff)
downloadyuzu-bf5b5c1bf43946039d91f78253599c9996f86057.tar
yuzu-bf5b5c1bf43946039d91f78253599c9996f86057.tar.gz
yuzu-bf5b5c1bf43946039d91f78253599c9996f86057.tar.bz2
yuzu-bf5b5c1bf43946039d91f78253599c9996f86057.tar.lz
yuzu-bf5b5c1bf43946039d91f78253599c9996f86057.tar.xz
yuzu-bf5b5c1bf43946039d91f78253599c9996f86057.tar.zst
yuzu-bf5b5c1bf43946039d91f78253599c9996f86057.zip
Diffstat (limited to '')
-rw-r--r--src/common/thread_worker.h6
1 files changed, 4 insertions, 2 deletions
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 <vector>
#include <queue>
+#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<void()>&& work);
+ void QueueWork(UniqueFunction<void> work);
void WaitForRequests();
private:
std::vector<std::thread> threads;
- std::queue<std::function<void()>> requests;
+ std::queue<UniqueFunction<void>> requests;
std::mutex queue_mutex;
std::condition_variable condition;
std::condition_variable wait_condition;