mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-10 03:58:08 -05:00
core/core: Move process execution start to System's Load()
This gives us significantly more control over where in the initialization process we start execution of the main process. Previously we were running the main process before the CPU or GPU threads were initialized (not good). This amends execution to start after all of our threads are properly set up.
This commit is contained in:
@ -168,7 +168,7 @@ struct System::Impl {
|
||||
}
|
||||
|
||||
auto main_process = Kernel::Process::Create(system, "main");
|
||||
const Loader::ResultStatus load_result{app_loader->Load(*main_process)};
|
||||
const auto [load_result, load_parameters] = app_loader->Load(*main_process);
|
||||
if (load_result != Loader::ResultStatus::Success) {
|
||||
LOG_CRITICAL(Core, "Failed to load ROM (Error {})!", static_cast<int>(load_result));
|
||||
Shutdown();
|
||||
@ -183,6 +183,10 @@ struct System::Impl {
|
||||
gpu_core->Start();
|
||||
cpu_core_manager.StartThreads();
|
||||
|
||||
// All threads are started, begin main process execution, now that we're in the clear.
|
||||
main_process->Run(load_parameters->main_thread_priority,
|
||||
load_parameters->main_thread_stack_size);
|
||||
|
||||
status = ResultStatus::Success;
|
||||
return status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user