mirror of
https://github.com/starr-dusT/yuzu-mainline
synced 2024-03-05 21:12:25 -08:00
Scheduler: Set last running time on thread.
This commit is contained in:
parent
9e9c287f8b
commit
391f5f360d
@ -616,6 +616,7 @@ void Scheduler::SwitchContextStep2() {
|
|||||||
|
|
||||||
// Cancel any outstanding wakeup events for this thread
|
// Cancel any outstanding wakeup events for this thread
|
||||||
new_thread->SetIsRunning(true);
|
new_thread->SetIsRunning(true);
|
||||||
|
new_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
|
||||||
|
|
||||||
auto* const thread_owner_process = current_thread->GetOwnerProcess();
|
auto* const thread_owner_process = current_thread->GetOwnerProcess();
|
||||||
if (previous_process != thread_owner_process && thread_owner_process != nullptr) {
|
if (previous_process != thread_owner_process && thread_owner_process != nullptr) {
|
||||||
@ -654,6 +655,7 @@ void Scheduler::SwitchContext() {
|
|||||||
|
|
||||||
// Save context for previous thread
|
// Save context for previous thread
|
||||||
if (previous_thread) {
|
if (previous_thread) {
|
||||||
|
previous_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
|
||||||
if (!previous_thread->IsHLEThread()) {
|
if (!previous_thread->IsHLEThread()) {
|
||||||
auto& cpu_core = system.ArmInterface(core_id);
|
auto& cpu_core = system.ArmInterface(core_id);
|
||||||
cpu_core.SaveContext(previous_thread->GetContext32());
|
cpu_core.SaveContext(previous_thread->GetContext32());
|
||||||
|
@ -295,10 +295,6 @@ void Thread::SetStatus(ThreadStatus new_status) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status == ThreadStatus::Running) {
|
|
||||||
last_running_ticks = Core::System::GetInstance().CoreTiming().GetCPUTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
status = new_status;
|
status = new_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user