diff options
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 1bd5d9ebf..0a5441684 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -64,7 +64,7 @@ void Thread::Stop() { | |||
| 64 | // Clean up thread from ready queue | 64 | // Clean up thread from ready queue |
| 65 | // This is only needed when the thread is termintated forcefully (SVC TerminateProcess) | 65 | // This is only needed when the thread is termintated forcefully (SVC TerminateProcess) |
| 66 | if (status == THREADSTATUS_READY) { | 66 | if (status == THREADSTATUS_READY) { |
| 67 | Core::System::GetInstance().Scheduler().UnscheduleThread(this, current_priority); | 67 | scheduler->UnscheduleThread(this, current_priority); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | status = THREADSTATUS_DEAD; | 70 | status = THREADSTATUS_DEAD; |
| @@ -92,7 +92,7 @@ void WaitCurrentThread_Sleep() { | |||
| 92 | void ExitCurrentThread() { | 92 | void ExitCurrentThread() { |
| 93 | Thread* thread = GetCurrentThread(); | 93 | Thread* thread = GetCurrentThread(); |
| 94 | thread->Stop(); | 94 | thread->Stop(); |
| 95 | Core::System::GetInstance().Scheduler().RemoveThread(thread); | 95 | Core::System::GetInstance().CurrentScheduler().RemoveThread(thread); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | /** | 98 | /** |
| @@ -188,7 +188,7 @@ void Thread::ResumeFromWait() { | |||
| 188 | wakeup_callback = nullptr; | 188 | wakeup_callback = nullptr; |
| 189 | 189 | ||
| 190 | status = THREADSTATUS_READY; | 190 | status = THREADSTATUS_READY; |
| 191 | Core::System::GetInstance().Scheduler().ScheduleThread(this, current_priority); | 191 | scheduler->ScheduleThread(this, current_priority); |
| 192 | Core::System::GetInstance().PrepareReschedule(); | 192 | Core::System::GetInstance().PrepareReschedule(); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| @@ -259,8 +259,6 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, | |||
| 259 | 259 | ||
| 260 | SharedPtr<Thread> thread(new Thread); | 260 | SharedPtr<Thread> thread(new Thread); |
| 261 | 261 | ||
| 262 | Core::System::GetInstance().Scheduler().AddThread(thread, priority); | ||
| 263 | |||
| 264 | thread->thread_id = NewThreadId(); | 262 | thread->thread_id = NewThreadId(); |
| 265 | thread->status = THREADSTATUS_DORMANT; | 263 | thread->status = THREADSTATUS_DORMANT; |
| 266 | thread->entry_point = entry_point; | 264 | thread->entry_point = entry_point; |
| @@ -275,6 +273,8 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, | |||
| 275 | thread->name = std::move(name); | 273 | thread->name = std::move(name); |
| 276 | thread->callback_handle = wakeup_callback_handle_table.Create(thread).Unwrap(); | 274 | thread->callback_handle = wakeup_callback_handle_table.Create(thread).Unwrap(); |
| 277 | thread->owner_process = owner_process; | 275 | thread->owner_process = owner_process; |
| 276 | thread->scheduler = Core::System().GetInstance().Scheduler(static_cast<size_t>(processor_id)); | ||
| 277 | thread->scheduler->AddThread(thread, priority); | ||
| 278 | 278 | ||
| 279 | // Find the next available TLS index, and mark it as used | 279 | // Find the next available TLS index, and mark it as used |
| 280 | auto& tls_slots = owner_process->tls_slots; | 280 | auto& tls_slots = owner_process->tls_slots; |
| @@ -337,7 +337,7 @@ void Thread::SetPriority(u32 priority) { | |||
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | void Thread::BoostPriority(u32 priority) { | 339 | void Thread::BoostPriority(u32 priority) { |
| 340 | Core::System::GetInstance().Scheduler().SetThreadPriority(this, priority); | 340 | scheduler->SetThreadPriority(this, priority); |
| 341 | current_priority = priority; | 341 | current_priority = priority; |
| 342 | } | 342 | } |
| 343 | 343 | ||
| @@ -406,7 +406,7 @@ void Thread::UpdatePriority() { | |||
| 406 | if (new_priority == current_priority) | 406 | if (new_priority == current_priority) |
| 407 | return; | 407 | return; |
| 408 | 408 | ||
| 409 | Core::System::GetInstance().Scheduler().SetThreadPriority(this, new_priority); | 409 | scheduler->SetThreadPriority(this, new_priority); |
| 410 | 410 | ||
| 411 | current_priority = new_priority; | 411 | current_priority = new_priority; |
| 412 | 412 | ||
| @@ -421,7 +421,7 @@ void Thread::UpdatePriority() { | |||
| 421 | * Gets the current thread | 421 | * Gets the current thread |
| 422 | */ | 422 | */ |
| 423 | Thread* GetCurrentThread() { | 423 | Thread* GetCurrentThread() { |
| 424 | return Core::System::GetInstance().Scheduler().GetCurrentThread(); | 424 | return Core::System::GetInstance().CurrentScheduler().GetCurrentThread(); |
| 425 | } | 425 | } |
| 426 | 426 | ||
| 427 | void ThreadingInit() { | 427 | void ThreadingInit() { |