Skip to content
Snippets Groups Projects
Commit fa228ca6 authored by Subv's avatar Subv
Browse files

Kernel/Threads: Don't immediately switch to the new main thread when loading a new process.

This is necessary for loading multiple processes at the same time.
The main thread will be automatically scheduled when necessary once the scheduler runs.
parent 46d1ca76
No related branches found
No related tags found
No related merge requests found
...@@ -478,8 +478,6 @@ void Thread::BoostPriority(s32 priority) { ...@@ -478,8 +478,6 @@ void Thread::BoostPriority(s32 priority) {
} }
SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority) { SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority) {
DEBUG_ASSERT(!GetCurrentThread());
// Initialize new "main" thread // Initialize new "main" thread
auto thread_res = Thread::Create("main", entry_point, priority, 0, THREADPROCESSORID_0, auto thread_res = Thread::Create("main", entry_point, priority, 0, THREADPROCESSORID_0,
Memory::HEAP_VADDR_END); Memory::HEAP_VADDR_END);
...@@ -489,9 +487,7 @@ SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority) { ...@@ -489,9 +487,7 @@ SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority) {
thread->context.fpscr = thread->context.fpscr =
FPSCR_DEFAULT_NAN | FPSCR_FLUSH_TO_ZERO | FPSCR_ROUND_TOZERO | FPSCR_IXC; // 0x03C00010 FPSCR_DEFAULT_NAN | FPSCR_FLUSH_TO_ZERO | FPSCR_ROUND_TOZERO | FPSCR_IXC; // 0x03C00010
// Run new "main" thread // Note: The newly created thread will be run when the scheduler fires.
SwitchContext(thread.get());
return thread; return thread;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment