summaryrefslogtreecommitdiff
path: root/Source/Core/Common/WorkQueueThread.h
diff options
context:
space:
mode:
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()
{
{