LV2: Optimizations and fixes

Fix and optimize sys_ppu_thread_yield

Fix LV2 syscalls with timeout bug. (use ppu_thread::cancel_sleep instead)

Move timeout notification out of mutex scope

Allow g_waiting timeouts to be awaked in scope
This commit is contained in:
Elad Ashkenazi 2022-08-08 08:33:49 +03:00 committed by Ivan
parent cba4c3cdc4
commit c4cc0154be
10 changed files with 260 additions and 202 deletions

View file

@ -700,6 +700,12 @@ bool cpu_thread::check_state() noexcept
store = true;
}
if (flags & cpu_flag::notify)
{
flags -= cpu_flag::notify;
store = true;
}
// Can't process dbg_step if we only paused temporarily
if (cpu_can_stop && flags & cpu_flag::dbg_step)
{
@ -779,6 +785,8 @@ bool cpu_thread::check_state() noexcept
if ((state1 ^ state) - pending_and_temp)
{
// Work could have changed flags
// Reset internal flags as if check_state() has just been called
cpu_sleep_called = false;
continue;
}
}