1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-26 04:32:35 +01:00

CPU: remove descheduled threads from suspend_all list

This commit is contained in:
Nekotekina 2020-11-20 08:40:49 +03:00
parent 85880ffded
commit 5bcaa25c02

View File

@ -1115,9 +1115,15 @@ DECLARE(lv2_obj::g_waiting);
thread_local DECLARE(lv2_obj::g_to_awake);
namespace cpu_counter
{
void remove(cpu_thread*) noexcept;
}
void lv2_obj::sleep(cpu_thread& cpu, const u64 timeout)
{
vm::temporary_unlock(cpu);
cpu_counter::remove(&cpu);
std::lock_guard{g_mutex}, sleep_unlocked(cpu, timeout);
g_to_awake.clear();
}