mirror of https://github.com/PCSX2/pcsx2.git
MTVU: Fix hang on shutdown if thread never opened
This commit is contained in:
parent
dcbb1483b9
commit
c44266eb82
|
@ -100,7 +100,7 @@ VU_Thread::~VU_Thread()
|
||||||
|
|
||||||
void VU_Thread::Open()
|
void VU_Thread::Open()
|
||||||
{
|
{
|
||||||
if (m_thread.Joinable())
|
if (IsOpen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Reset();
|
Reset();
|
||||||
|
@ -111,7 +111,7 @@ void VU_Thread::Open()
|
||||||
|
|
||||||
void VU_Thread::Close()
|
void VU_Thread::Close()
|
||||||
{
|
{
|
||||||
if (!m_thread.Joinable())
|
if (!IsOpen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_shutdown_flag.store(true, std::memory_order_release);
|
m_shutdown_flag.store(true, std::memory_order_release);
|
||||||
|
|
|
@ -66,6 +66,8 @@ public:
|
||||||
~VU_Thread();
|
~VU_Thread();
|
||||||
|
|
||||||
__fi const Threading::ThreadHandle& GetThreadHandle() const { return m_thread; }
|
__fi const Threading::ThreadHandle& GetThreadHandle() const { return m_thread; }
|
||||||
|
|
||||||
|
/// Returns true if the VU thread has been started.
|
||||||
__fi bool IsOpen() const { return m_thread.Joinable(); }
|
__fi bool IsOpen() const { return m_thread.Joinable(); }
|
||||||
|
|
||||||
/// Ensures the VU thread is started.
|
/// Ensures the VU thread is started.
|
||||||
|
|
Loading…
Reference in New Issue