From 9badcc6eb8b95252bac91305b06e1c0ebaea329a Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Fri, 27 Jan 2023 15:05:51 +0100 Subject: [PATCH] WorkQueueThread: Add Push --- Source/Core/Common/WorkQueueThread.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Source/Core/Common/WorkQueueThread.h b/Source/Core/Common/WorkQueueThread.h index f74c164e60..7d3d9395fb 100644 --- a/Source/Core/Common/WorkQueueThread.h +++ b/Source/Core/Common/WorkQueueThread.h @@ -42,6 +42,26 @@ public: m_wakeup.Set(); } + void Push(T&& item) + { + if (!m_cancelled.IsSet()) + { + std::lock_guard lg(m_lock); + m_items.push(item); + } + m_wakeup.Set(); + } + + void Push(const T& item) + { + if (!m_cancelled.IsSet()) + { + std::lock_guard lg(m_lock); + m_items.push(item); + } + m_wakeup.Set(); + } + void Clear() { {