mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 21:58:48 +00:00
WorkQueueThread: Add Push
This commit is contained in:
parent
512273a507
commit
9badcc6eb8
1 changed files with 20 additions and 0 deletions
|
@ -42,6 +42,26 @@ public:
|
||||||
m_wakeup.Set();
|
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()
|
void Clear()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue