Merge pull request #478 from PCSX2/linux-mtvu-crash-after-shutdown

MTVU: fix linux crash after a shutdown
This commit is contained in:
Gregory Hainaut 2015-04-11 13:15:34 +02:00
commit 06ee41957e
2 changed files with 9 additions and 0 deletions

View File

@ -69,6 +69,8 @@ VU_Thread::~VU_Thread() throw()
void VU_Thread::Reset()
{
ScopedLock lock(mtxBusy);
read_pos = 0;
write_pos = 0;
write_offset = 0;

View File

@ -18,6 +18,7 @@
#include "IopCommon.h"
#include "VUmicro.h"
#include "newVif.h"
#include "MTVU.h"
#include "SamplProf.h"
@ -418,6 +419,12 @@ void SysMainMemory::DecommitAll()
Console.WriteLn( Color_Blue, "Decommitting host memory for virtual systems..." );
ConsoleIndentScope indent(1);
// On linux, the MTVU isn't empty and the thread still uses the m_ee/m_vu memory
vu1Thread.WaitVU();
// The EE thread must be stopped here command mustn't be send
// to the ring. Let's call it an extra safety valve :)
vu1Thread.Reset();
m_ee.Decommit();
m_iop.Decommit();
m_vu.Decommit();