summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-06 04:33:03 +0200
committerGitHub <noreply@github.com>2018-10-06 04:33:03 +0200
commitd43769f93f09f3d53fbe63d096e9cbab741ea6a8 (patch)
tree4bbb722ae36f032c031018bf8650bcc3f2cd8faf
parentMerge pull request #1439 from lioncash/thread (diff)
parentthread: Make the scheduler pointer a regular pointer (diff)
downloadyuzu-d43769f93f09f3d53fbe63d096e9cbab741ea6a8.tar
yuzu-d43769f93f09f3d53fbe63d096e9cbab741ea6a8.tar.gz
yuzu-d43769f93f09f3d53fbe63d096e9cbab741ea6a8.tar.bz2
yuzu-d43769f93f09f3d53fbe63d096e9cbab741ea6a8.tar.lz
yuzu-d43769f93f09f3d53fbe63d096e9cbab741ea6a8.tar.xz
yuzu-d43769f93f09f3d53fbe63d096e9cbab741ea6a8.tar.zst
yuzu-d43769f93f09f3d53fbe63d096e9cbab741ea6a8.zip
-rw-r--r--src/core/hle/kernel/thread.cpp6
-rw-r--r--src/core/hle/kernel/thread.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 354043c53..8e514cf9a 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -169,7 +169,7 @@ void Thread::ResumeFromWait() {
next_scheduler->ScheduleThread(this, current_priority);
// Change thread's scheduler
- scheduler = next_scheduler;
+ scheduler = next_scheduler.get();
Core::System::GetInstance().CpuCore(processor_id).PrepareReschedule();
}
@@ -233,7 +233,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(KernelCore& kernel, std::string name
thread->name = std::move(name);
thread->callback_handle = kernel.ThreadWakeupCallbackHandleTable().Create(thread).Unwrap();
thread->owner_process = owner_process;
- thread->scheduler = Core::System::GetInstance().Scheduler(processor_id);
+ thread->scheduler = Core::System::GetInstance().Scheduler(processor_id).get();
thread->scheduler->AddThread(thread, priority);
thread->tls_address = thread->owner_process->MarkNextAvailableTLSSlotAsUsed(*thread);
@@ -400,7 +400,7 @@ void Thread::ChangeCore(u32 core, u64 mask) {
next_scheduler->ScheduleThread(this, current_priority);
// Change thread's scheduler
- scheduler = next_scheduler;
+ scheduler = next_scheduler.get();
Core::System::GetInstance().CpuCore(processor_id).PrepareReschedule();
}
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index d2b191357..c6ffbd28c 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -419,7 +419,7 @@ private:
/// available. In case of a timeout, the object will be nullptr.
WakeupCallback wakeup_callback;
- std::shared_ptr<Scheduler> scheduler;
+ Scheduler* scheduler = nullptr;
u32 ideal_core{0xFFFFFFFF};
u64 affinity_mask{0x1};