diff options
| author | 2018-07-18 18:55:58 -0700 | |
|---|---|---|
| committer | 2018-07-18 18:55:58 -0700 | |
| commit | 49b0966003caeaafe2f5455d06b16175f02686fb (patch) | |
| tree | 141c8d3c09f9eca021dddedb17cdc3cc6607a19a /src/core/hle/kernel/thread.cpp | |
| parent | Merge pull request #680 from bunnei/fix-swizz (diff) | |
| parent | core: Make System's default constructor private (diff) | |
| download | yuzu-49b0966003caeaafe2f5455d06b16175f02686fb.tar.gz yuzu-49b0966003caeaafe2f5455d06b16175f02686fb.tar.xz yuzu-49b0966003caeaafe2f5455d06b16175f02686fb.zip | |
Merge pull request #687 from lioncash/instance
core: Don't construct instance of Core::System, just to access its live instance
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 9a9746585..0b3c66428 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -165,7 +165,7 @@ void Thread::CancelWakeupTimer() { | |||
| 165 | static boost::optional<s32> GetNextProcessorId(u64 mask) { | 165 | static boost::optional<s32> GetNextProcessorId(u64 mask) { |
| 166 | for (s32 index = 0; index < Core::NUM_CPU_CORES; ++index) { | 166 | for (s32 index = 0; index < Core::NUM_CPU_CORES; ++index) { |
| 167 | if (mask & (1ULL << index)) { | 167 | if (mask & (1ULL << index)) { |
| 168 | if (!Core::System().GetInstance().Scheduler(index)->GetCurrentThread()) { | 168 | if (!Core::System::GetInstance().Scheduler(index)->GetCurrentThread()) { |
| 169 | // Core is enabled and not running any threads, use this one | 169 | // Core is enabled and not running any threads, use this one |
| 170 | return index; | 170 | return index; |
| 171 | } | 171 | } |
| @@ -215,14 +215,14 @@ void Thread::ResumeFromWait() { | |||
| 215 | new_processor_id = processor_id; | 215 | new_processor_id = processor_id; |
| 216 | } | 216 | } |
| 217 | if (ideal_core != -1 && | 217 | if (ideal_core != -1 && |
| 218 | Core::System().GetInstance().Scheduler(ideal_core)->GetCurrentThread() == nullptr) { | 218 | Core::System::GetInstance().Scheduler(ideal_core)->GetCurrentThread() == nullptr) { |
| 219 | new_processor_id = ideal_core; | 219 | new_processor_id = ideal_core; |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | ASSERT(*new_processor_id < 4); | 222 | ASSERT(*new_processor_id < 4); |
| 223 | 223 | ||
| 224 | // Add thread to new core's scheduler | 224 | // Add thread to new core's scheduler |
| 225 | auto& next_scheduler = Core::System().GetInstance().Scheduler(*new_processor_id); | 225 | auto& next_scheduler = Core::System::GetInstance().Scheduler(*new_processor_id); |
| 226 | 226 | ||
| 227 | if (*new_processor_id != processor_id) { | 227 | if (*new_processor_id != processor_id) { |
| 228 | // Remove thread from previous core's scheduler | 228 | // Remove thread from previous core's scheduler |
| @@ -325,7 +325,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, | |||
| 325 | thread->name = std::move(name); | 325 | thread->name = std::move(name); |
| 326 | thread->callback_handle = wakeup_callback_handle_table.Create(thread).Unwrap(); | 326 | thread->callback_handle = wakeup_callback_handle_table.Create(thread).Unwrap(); |
| 327 | thread->owner_process = owner_process; | 327 | thread->owner_process = owner_process; |
| 328 | thread->scheduler = Core::System().GetInstance().Scheduler(processor_id); | 328 | thread->scheduler = Core::System::GetInstance().Scheduler(processor_id); |
| 329 | thread->scheduler->AddThread(thread, priority); | 329 | thread->scheduler->AddThread(thread, priority); |
| 330 | 330 | ||
| 331 | // Find the next available TLS index, and mark it as used | 331 | // Find the next available TLS index, and mark it as used |
| @@ -481,14 +481,14 @@ void Thread::ChangeCore(u32 core, u64 mask) { | |||
| 481 | new_processor_id = processor_id; | 481 | new_processor_id = processor_id; |
| 482 | } | 482 | } |
| 483 | if (ideal_core != -1 && | 483 | if (ideal_core != -1 && |
| 484 | Core::System().GetInstance().Scheduler(ideal_core)->GetCurrentThread() == nullptr) { | 484 | Core::System::GetInstance().Scheduler(ideal_core)->GetCurrentThread() == nullptr) { |
| 485 | new_processor_id = ideal_core; | 485 | new_processor_id = ideal_core; |
| 486 | } | 486 | } |
| 487 | 487 | ||
| 488 | ASSERT(*new_processor_id < 4); | 488 | ASSERT(*new_processor_id < 4); |
| 489 | 489 | ||
| 490 | // Add thread to new core's scheduler | 490 | // Add thread to new core's scheduler |
| 491 | auto& next_scheduler = Core::System().GetInstance().Scheduler(*new_processor_id); | 491 | auto& next_scheduler = Core::System::GetInstance().Scheduler(*new_processor_id); |
| 492 | 492 | ||
| 493 | if (*new_processor_id != processor_id) { | 493 | if (*new_processor_id != processor_id) { |
| 494 | // Remove thread from previous core's scheduler | 494 | // Remove thread from previous core's scheduler |