mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
@ -54,7 +54,7 @@ public:
|
||||
void Wait()
|
||||
{
|
||||
// already done
|
||||
if (m_stopped.IsSet() || m_running_state.load() <= STATE_DONE)
|
||||
if (IsDone())
|
||||
return;
|
||||
|
||||
// notifying this event will only wake up one thread, so use a mutex here to
|
||||
@ -63,7 +63,7 @@ public:
|
||||
std::lock_guard<std::mutex> lk(m_wait_lock);
|
||||
|
||||
// Wait for the worker thread to finish.
|
||||
while (!m_stopped.IsSet() && m_running_state.load() > STATE_DONE)
|
||||
while (!IsDone())
|
||||
{
|
||||
m_done_event.Wait();
|
||||
}
|
||||
@ -183,6 +183,11 @@ public:
|
||||
return !m_stopped.IsSet() && !m_shutdown.IsSet();
|
||||
}
|
||||
|
||||
bool IsDone() const
|
||||
{
|
||||
return m_stopped.IsSet() || m_running_state.load() <= STATE_DONE;
|
||||
}
|
||||
|
||||
// This function should be triggered regularly over time so
|
||||
// that we will fall back from the busy loop to sleeping.
|
||||
void AllowSleep()
|
||||
|
Reference in New Issue
Block a user