diff options
| author | Robin Kertels <robin.kertels@gmail.com> | 2023-01-27 15:05:51 +0100 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2023-02-04 14:31:16 +1300 |
| commit | 9badcc6eb8b95252bac91305b06e1c0ebaea329a (patch) | |
| tree | 1d84a34b790820c359b577f9b78d1fd67290da91 /Source/Core/Common/WorkQueueThread.h | |
| parent | 512273a5077e1aaf6ab8506595d7d1e36e4d7a02 (diff) | |
WorkQueueThread: Add Push
Diffstat (limited to 'Source/Core/Common/WorkQueueThread.h')
| -rw-r--r-- | Source/Core/Common/WorkQueueThread.h | 20 |
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() { { |
