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))
|
||||
m_sem_Vsync.Post();
|
||||
|
||||
busy.Release();
|
||||
StateCheckInThread();
|
||||
busy.Acquire();
|
||||
// Do not StateCheckInThread() here
|
||||
// Otherwise we could pause while there's still data in the queue
|
||||
// Which could make the MTVU thread wait forever for it to empty
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -619,6 +619,8 @@ void SysMtgsThread::OnResumeInThread(bool isSuspended)
|
|||
void SysMtgsThread::OnCleanupInThread()
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue