Merge pull request #8332 from CookiePLMonster/dsp-lle-deadlock
DSPLLE: Put DSP thread in idle state when it's paused
This commit is contained in:
commit
e33acc07f9
|
@ -98,22 +98,24 @@ void DSPLLE::DSPThread(DSPLLE* dsp_lle)
|
|||
const int cycles = static_cast<int>(dsp_lle->m_cycle_count.load());
|
||||
if (cycles > 0)
|
||||
{
|
||||
std::lock_guard<std::mutex> dsp_thread_lock(dsp_lle->m_dsp_thread_mutex);
|
||||
if (g_dsp_jit)
|
||||
std::unique_lock dsp_thread_lock(dsp_lle->m_dsp_thread_mutex, std::try_to_lock);
|
||||
if (dsp_thread_lock)
|
||||
{
|
||||
DSPCore_RunCycles(cycles);
|
||||
if (g_dsp_jit)
|
||||
{
|
||||
DSPCore_RunCycles(cycles);
|
||||
}
|
||||
else
|
||||
{
|
||||
DSP::Interpreter::RunCyclesThread(cycles);
|
||||
}
|
||||
dsp_lle->m_cycle_count.store(0);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
DSP::Interpreter::RunCyclesThread(cycles);
|
||||
}
|
||||
dsp_lle->m_cycle_count.store(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_ppc_event.Set();
|
||||
s_dsp_event.Wait();
|
||||
}
|
||||
|
||||
s_ppc_event.Set();
|
||||
s_dsp_event.Wait();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -334,8 +336,16 @@ u32 DSPLLE::DSP_UpdateRate()
|
|||
void DSPLLE::PauseAndLock(bool do_lock, bool unpause_on_unlock)
|
||||
{
|
||||
if (do_lock)
|
||||
{
|
||||
m_dsp_thread_mutex.lock();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dsp_thread_mutex.unlock();
|
||||
|
||||
// Signal the DSP thread so it can perform any outstanding work now (if any)
|
||||
s_ppc_event.Wait();
|
||||
s_dsp_event.Set();
|
||||
}
|
||||
}
|
||||
} // namespace DSP::LLE
|
||||
|
|
Loading…
Reference in New Issue