Kernel: change owner_process in Thread/SharedMemory to raw pointer

Otherwise circular ownership would form in Process->handle_table->thread->owner_process
This commit is contained in:
Weiyi Wang 2018-10-25 19:54:06 -04:00
parent 8d32843d68
commit e5c5d1ecce
6 changed files with 11 additions and 12 deletions

View file

@ -320,8 +320,7 @@ static void ResetThreadContext(const std::unique_ptr<ARM_Interface::ThreadContex
ResultVal<SharedPtr<Thread>> KernelSystem::CreateThread(std::string name, VAddr entry_point,
u32 priority, u32 arg, s32 processor_id,
VAddr stack_top,
SharedPtr<Process> owner_process) {
VAddr stack_top, Process* owner_process) {
// Check if priority is in ranged. Lowest priority -> highest priority id.
if (priority > ThreadPrioLowest) {
LOG_ERROR(Kernel_SVC, "Invalid thread priority: {}", priority);
@ -447,7 +446,7 @@ SharedPtr<Thread> SetupMainThread(KernelSystem& kernel, u32 entry_point, u32 pri
// Initialize new "main" thread
auto thread_res =
kernel.CreateThread("main", entry_point, priority, 0, owner_process->ideal_processor,
Memory::HEAP_VADDR_END, owner_process);
Memory::HEAP_VADDR_END, owner_process.get());
SharedPtr<Thread> thread = std::move(thread_res).Unwrap();