mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
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());
|
const int cycles = static_cast<int>(dsp_lle->m_cycle_count.load());
|
||||||
if (cycles > 0)
|
if (cycles > 0)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> dsp_thread_lock(dsp_lle->m_dsp_thread_mutex);
|
std::unique_lock dsp_thread_lock(dsp_lle->m_dsp_thread_mutex, std::try_to_lock);
|
||||||
if (g_dsp_jit)
|
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)
|
void DSPLLE::PauseAndLock(bool do_lock, bool unpause_on_unlock)
|
||||||
{
|
{
|
||||||
if (do_lock)
|
if (do_lock)
|
||||||
|
{
|
||||||
m_dsp_thread_mutex.lock();
|
m_dsp_thread_mutex.lock();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
m_dsp_thread_mutex.unlock();
|
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
|
} // namespace DSP::LLE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user