Core/CPU: Do not yield to UI from CPU methods
Core::RunAsCPUThread may be called from Qt signals, and if code yields to UI there then it results in infinite recursion
This commit is contained in:
parent
7520306671
commit
2bc9e09456
|
@ -183,10 +183,7 @@ void Stop()
|
||||||
|
|
||||||
while (s_state_cpu_thread_active)
|
while (s_state_cpu_thread_active)
|
||||||
{
|
{
|
||||||
std::cv_status status =
|
s_state_cpu_idle_cvar.wait(state_lock);
|
||||||
s_state_cpu_idle_cvar.wait_for(state_lock, std::chrono::milliseconds(100));
|
|
||||||
if (status == std::cv_status::timeout)
|
|
||||||
Host_YieldToUI();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RunAdjacentSystems(false);
|
RunAdjacentSystems(false);
|
||||||
|
@ -252,10 +249,7 @@ void EnableStepping(bool stepping)
|
||||||
|
|
||||||
while (s_state_cpu_thread_active)
|
while (s_state_cpu_thread_active)
|
||||||
{
|
{
|
||||||
std::cv_status status =
|
s_state_cpu_idle_cvar.wait(state_lock);
|
||||||
s_state_cpu_idle_cvar.wait_for(state_lock, std::chrono::milliseconds(100));
|
|
||||||
if (status == std::cv_status::timeout)
|
|
||||||
Host_YieldToUI();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RunAdjacentSystems(false);
|
RunAdjacentSystems(false);
|
||||||
|
@ -303,10 +297,7 @@ bool PauseAndLock(bool do_lock, bool unpause_on_unlock, bool control_adjacent)
|
||||||
|
|
||||||
while (s_state_cpu_thread_active)
|
while (s_state_cpu_thread_active)
|
||||||
{
|
{
|
||||||
std::cv_status status =
|
s_state_cpu_idle_cvar.wait(state_lock);
|
||||||
s_state_cpu_idle_cvar.wait_for(state_lock, std::chrono::milliseconds(100));
|
|
||||||
if (status == std::cv_status::timeout)
|
|
||||||
Host_YieldToUI();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control_adjacent)
|
if (control_adjacent)
|
||||||
|
|
Loading…
Reference in New Issue