From be4b0af971b179abcd00107aa6f3c018a462b8bc Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 29 Apr 2025 20:33:39 -0500 Subject: [PATCH 1/2] Common: Add AsyncWorkThread. --- Source/Core/Common/WorkQueueThread.h | 38 ++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/WorkQueueThread.h b/Source/Core/Common/WorkQueueThread.h index 190afcabf2..9ad7c4f471 100644 --- a/Source/Core/Common/WorkQueueThread.h +++ b/Source/Core/Common/WorkQueueThread.h @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -13,8 +14,6 @@ #include "Common/SPSCQueue.h" #include "Common/Thread.h" -// A thread that executes the given function for every item placed into its queue. - namespace Common { namespace detail @@ -158,6 +157,38 @@ private: using ProducerMutex = std::conditional_t; ProducerMutex m_mutex; }; + +// A WorkQueueThread-like class that takes functions to invoke. +template