summaryrefslogtreecommitdiff
path: root/Source/Core/Common/WorkQueueThread.h
diff options
context:
space:
mode:
authorRobin Kertels <robin.kertels@gmail.com>2023-01-27 15:05:51 +0100
committerScott Mansell <phiren@gmail.com>2023-02-04 14:31:16 +1300
commit9badcc6eb8b95252bac91305b06e1c0ebaea329a (patch)
tree1d84a34b790820c359b577f9b78d1fd67290da91 /Source/Core/Common/WorkQueueThread.h
parent512273a5077e1aaf6ab8506595d7d1e36e4d7a02 (diff)
WorkQueueThread: Add Push
Diffstat (limited to 'Source/Core/Common/WorkQueueThread.h')
-rw-r--r--Source/Core/Common/WorkQueueThread.h20
1 files changed, 20 insertions, 0 deletions
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()
{
{