mirror of https://github.com/PCSX2/pcsx2.git
MTGS: Only pause when the queue is empty
Prevents other threads from freezing waiting for the queue to empty when it never will
This commit is contained in:
parent
0f917c24a5
commit
4116aed738
|
@ -486,9 +486,9 @@ void SysMtgsThread::ExecuteTaskInThread()
|
||||||
if (m_VsyncSignalListener.exchange(false))
|
if (m_VsyncSignalListener.exchange(false))
|
||||||
m_sem_Vsync.Post();
|
m_sem_Vsync.Post();
|
||||||
|
|
||||||
busy.Release();
|
// Do not StateCheckInThread() here
|
||||||
StateCheckInThread();
|
// Otherwise we could pause while there's still data in the queue
|
||||||
busy.Acquire();
|
// Which could make the MTVU thread wait forever for it to empty
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -619,6 +619,8 @@ void SysMtgsThread::OnResumeInThread(bool isSuspended)
|
||||||
void SysMtgsThread::OnCleanupInThread()
|
void SysMtgsThread::OnCleanupInThread()
|
||||||
{
|
{
|
||||||
CloseGS();
|
CloseGS();
|
||||||
|
// Unblock any threads in WaitGS in case MTGS gets cancelled while still processing work
|
||||||
|
m_ReadPos.store(m_WritePos.load(std::memory_order_acquire), std::memory_order_relaxed);
|
||||||
_parent::OnCleanupInThread();
|
_parent::OnCleanupInThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue