mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-10-31 20:37:52 +00:00
core: cpu_manager: Use invalid core_id on init and simplify shutdown.
This commit is contained in:
parent
99bc49e76e
commit
9e3d1d865c
1 changed files with 3 additions and 7 deletions
|
@ -33,7 +33,7 @@ void CpuManager::Initialize() {
|
||||||
core_data[core].host_thread = std::jthread(ThreadStart, std::ref(*this), core);
|
core_data[core].host_thread = std::jthread(ThreadStart, std::ref(*this), core);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
core_data[0].host_thread = std::jthread(ThreadStart, std::ref(*this), 0);
|
core_data[0].host_thread = std::jthread(ThreadStart, std::ref(*this), -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,13 +348,9 @@ void CpuManager::RunThread(std::stop_token stop_token, std::size_t core) {
|
||||||
sc_sync_first_use = false;
|
sc_sync_first_use = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Abort if emulation was killed before the session really starts
|
// Emulation was stopped
|
||||||
if (!system.IsPoweredOn()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stop_token.stop_requested()) {
|
if (stop_token.stop_requested()) {
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto current_thread = system.Kernel().CurrentScheduler()->GetCurrentThread();
|
auto current_thread = system.Kernel().CurrentScheduler()->GetCurrentThread();
|
||||||
|
|
Loading…
Reference in a new issue