mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
PPU thread scheduler
This commit is contained in:
parent
e4962054a4
commit
598c90f376
41 changed files with 699 additions and 259 deletions
|
@ -89,6 +89,8 @@ cpu_thread::cpu_thread(u32 id)
|
|||
|
||||
bool cpu_thread::check_state()
|
||||
{
|
||||
bool cpu_sleep_called = false;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (test(state & cpu_flag::exit))
|
||||
|
@ -96,11 +98,23 @@ bool cpu_thread::check_state()
|
|||
return true;
|
||||
}
|
||||
|
||||
if (test(state & cpu_flag::signal) && state.test_and_reset(cpu_flag::signal))
|
||||
{
|
||||
cpu_sleep_called = false;
|
||||
}
|
||||
|
||||
if (!test(state & (cpu_state_pause + cpu_flag::dbg_global_stop)))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (test(state & cpu_flag::suspend) && !cpu_sleep_called)
|
||||
{
|
||||
cpu_sleep();
|
||||
cpu_sleep_called = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
thread_ctrl::wait();
|
||||
}
|
||||
|
||||
|
@ -126,12 +140,6 @@ void cpu_thread::run()
|
|||
notify();
|
||||
}
|
||||
|
||||
void cpu_thread::set_signal()
|
||||
{
|
||||
verify("cpu_flag::signal" HERE), !state.test_and_set(cpu_flag::signal);
|
||||
notify();
|
||||
}
|
||||
|
||||
std::string cpu_thread::dump() const
|
||||
{
|
||||
return fmt::format("Type: %s\n" "State: %s\n", typeid(*this).name(), state.load());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue