mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	kernel: be more careful about initialization path for HLE threads
This commit is contained in:
		@@ -70,6 +70,7 @@ void KScheduler::EnableScheduling(KernelCore& kernel, u64 cores_needing_scheduli
 | 
				
			|||||||
            GetCurrentThread(kernel).IfDummyThreadTryWait();
 | 
					            GetCurrentThread(kernel).IfDummyThreadTryWait();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        GetCurrentThread(kernel).EnableDispatch();
 | 
					        GetCurrentThread(kernel).EnableDispatch();
 | 
				
			||||||
 | 
					        ASSERT(GetCurrentThread(kernel).GetState() != ThreadState::Waiting);
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -258,7 +258,13 @@ Result KThread::InitializeThread(KThread* thread, KThreadFunction func, uintptr_
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Result KThread::InitializeDummyThread(KThread* thread) {
 | 
					Result KThread::InitializeDummyThread(KThread* thread) {
 | 
				
			||||||
    return thread->Initialize({}, {}, {}, DummyThreadPriority, 3, {}, ThreadType::Dummy);
 | 
					    // Initialize the thread.
 | 
				
			||||||
 | 
					    R_TRY(thread->Initialize({}, {}, {}, DummyThreadPriority, 3, {}, ThreadType::Dummy));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Initialize emulation parameters.
 | 
				
			||||||
 | 
					    thread->stack_parameters.disable_count = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return ResultSuccess;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Result KThread::InitializeMainThread(Core::System& system, KThread* thread, s32 virt_core) {
 | 
					Result KThread::InitializeMainThread(Core::System& system, KThread* thread, s32 virt_core) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user