mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Fix passive reservation locks checking at Emu.Stop() (#6482)
This commit is contained in:
parent
440d58f2ff
commit
10c81fbdf9
1 changed files with 8 additions and 3 deletions
|
@ -162,6 +162,11 @@ void cpu_thread::operator()()
|
||||||
thread_ctrl::wait();
|
thread_ctrl::wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (auto ptr = vm::g_tls_locked)
|
||||||
|
{
|
||||||
|
ptr->compare_and_swap(this, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
// Unregister and wait if necessary
|
// Unregister and wait if necessary
|
||||||
state += cpu_flag::wait;
|
state += cpu_flag::wait;
|
||||||
verify("g_cpu_array[...] -> null" HERE), g_cpu_array[array_slot].exchange(nullptr) == this;
|
verify("g_cpu_array[...] -> null" HERE), g_cpu_array[array_slot].exchange(nullptr) == this;
|
||||||
|
@ -262,12 +267,12 @@ bool cpu_thread::check_state() noexcept
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state & cpu_flag::wait)
|
if (state0 & cpu_flag::wait)
|
||||||
{
|
{
|
||||||
// Spin wait once for a bit before resorting to thread_ctrl::wait
|
// Spin wait once for a bit before resorting to thread_ctrl::wait
|
||||||
for (u32 i = 0; i < 10; i++)
|
for (u32 i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
if (state0 & (cpu_flag::pause + cpu_flag::suspend))
|
if (state & (cpu_flag::pause + cpu_flag::suspend))
|
||||||
{
|
{
|
||||||
busy_wait(500);
|
busy_wait(500);
|
||||||
}
|
}
|
||||||
|
@ -277,7 +282,7 @@ bool cpu_thread::check_state() noexcept
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(state0 & (cpu_flag::pause + cpu_flag::suspend)))
|
if (!(state & (cpu_flag::pause + cpu_flag::suspend)))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue