2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #1445 from lioncash/sched

thread: Make the scheduler pointer a regular pointer
This commit is contained in:
bunnei 2018-10-05 22:33:03 -04:00 committed by GitHub
commit d43769f93f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -169,7 +169,7 @@ void Thread::ResumeFromWait() {
next_scheduler->ScheduleThread(this, current_priority); next_scheduler->ScheduleThread(this, current_priority);
// Change thread's scheduler // Change thread's scheduler
scheduler = next_scheduler; scheduler = next_scheduler.get();
Core::System::GetInstance().CpuCore(processor_id).PrepareReschedule(); 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->name = std::move(name);
thread->callback_handle = kernel.ThreadWakeupCallbackHandleTable().Create(thread).Unwrap(); thread->callback_handle = kernel.ThreadWakeupCallbackHandleTable().Create(thread).Unwrap();
thread->owner_process = owner_process; 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->scheduler->AddThread(thread, priority);
thread->tls_address = thread->owner_process->MarkNextAvailableTLSSlotAsUsed(*thread); 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); next_scheduler->ScheduleThread(this, current_priority);
// Change thread's scheduler // Change thread's scheduler
scheduler = next_scheduler; scheduler = next_scheduler.get();
Core::System::GetInstance().CpuCore(processor_id).PrepareReschedule(); Core::System::GetInstance().CpuCore(processor_id).PrepareReschedule();
} }

View file

@ -419,7 +419,7 @@ private:
/// available. In case of a timeout, the object will be nullptr. /// available. In case of a timeout, the object will be nullptr.
WakeupCallback wakeup_callback; WakeupCallback wakeup_callback;
std::shared_ptr<Scheduler> scheduler; Scheduler* scheduler = nullptr;
u32 ideal_core{0xFFFFFFFF}; u32 ideal_core{0xFFFFFFFF};
u64 affinity_mask{0x1}; u64 affinity_mask{0x1};