mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-17 22:41:03 +02:00
WorkQueueThread: Implement proper Flush
and rename the existing Flush to FlushOne.
This commit is contained in:
committed by
Scott Mansell
parent
9badcc6eb8
commit
9affbfe683
@@ -91,7 +91,7 @@ public:
|
||||
}
|
||||
|
||||
// Doesn't return until the most recent function invocation has finished.
|
||||
void Flush()
|
||||
void FlushOne()
|
||||
{
|
||||
if (m_thread.joinable())
|
||||
{
|
||||
@@ -101,6 +101,17 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// Doesn't return until the queue is empty.
|
||||
void Flush()
|
||||
{
|
||||
if (m_thread.joinable())
|
||||
{
|
||||
m_flush.Set();
|
||||
m_wakeup.Set();
|
||||
m_flushed.Wait();
|
||||
}
|
||||
}
|
||||
|
||||
bool IsFlushing() const { return m_flush.IsSet() || m_shutdown.IsSet(); }
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user