summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/scheduler.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-03-07 12:44:35 -0400
committerGravatar Fernando Sahmkow2020-06-27 11:35:33 -0400
commit83c7ba1ef700eff17f30b6c2782db77710dc322e (patch)
tree63b5901d96afa6a823a8a14859db84d6c74a283d /src/core/hle/kernel/scheduler.cpp
parentSCC: Small corrections to CancelSynchronization (diff)
downloadyuzu-83c7ba1ef700eff17f30b6c2782db77710dc322e.tar.gz
yuzu-83c7ba1ef700eff17f30b6c2782db77710dc322e.tar.xz
yuzu-83c7ba1ef700eff17f30b6c2782db77710dc322e.zip
SVC: Correct SetThreadActivity.
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
-rw-r--r--src/core/hle/kernel/scheduler.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index f020438fb..a37b992ec 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -417,8 +417,7 @@ void GlobalScheduler::AdjustSchedulingOnStatus(Thread* thread, u32 old_flags) {
417 } 417 }
418 ASSERT(is_locked); 418 ASSERT(is_locked);
419 419
420 if (static_cast<ThreadSchedStatus>(old_flags & static_cast<u32>(ThreadSchedMasks::LowMask)) == 420 if (old_flags == static_cast<u32>(ThreadSchedStatus::Runnable)) {
421 ThreadSchedStatus::Runnable) {
422 // In this case the thread was running, now it's pausing/exitting 421 // In this case the thread was running, now it's pausing/exitting
423 if (thread->processor_id >= 0) { 422 if (thread->processor_id >= 0) {
424 Unschedule(thread->current_priority, static_cast<u32>(thread->processor_id), thread); 423 Unschedule(thread->current_priority, static_cast<u32>(thread->processor_id), thread);
@@ -430,7 +429,7 @@ void GlobalScheduler::AdjustSchedulingOnStatus(Thread* thread, u32 old_flags) {
430 Unsuggest(thread->current_priority, core, thread); 429 Unsuggest(thread->current_priority, core, thread);
431 } 430 }
432 } 431 }
433 } else if (thread->GetSchedulingStatus() == ThreadSchedStatus::Runnable) { 432 } else if (thread->scheduling_state == static_cast<u32>(ThreadSchedStatus::Runnable)) {
434 // The thread is now set to running from being stopped 433 // The thread is now set to running from being stopped
435 if (thread->processor_id >= 0) { 434 if (thread->processor_id >= 0) {
436 Schedule(thread->current_priority, static_cast<u32>(thread->processor_id), thread); 435 Schedule(thread->current_priority, static_cast<u32>(thread->processor_id), thread);
@@ -448,7 +447,7 @@ void GlobalScheduler::AdjustSchedulingOnStatus(Thread* thread, u32 old_flags) {
448} 447}
449 448
450void GlobalScheduler::AdjustSchedulingOnPriority(Thread* thread, u32 old_priority) { 449void GlobalScheduler::AdjustSchedulingOnPriority(Thread* thread, u32 old_priority) {
451 if (thread->GetSchedulingStatus() != ThreadSchedStatus::Runnable) { 450 if (thread->scheduling_state != static_cast<u32>(ThreadSchedStatus::Runnable)) {
452 return; 451 return;
453 } 452 }
454 ASSERT(is_locked); 453 ASSERT(is_locked);
@@ -486,7 +485,7 @@ void GlobalScheduler::AdjustSchedulingOnPriority(Thread* thread, u32 old_priorit
486 485
487void GlobalScheduler::AdjustSchedulingOnAffinity(Thread* thread, u64 old_affinity_mask, 486void GlobalScheduler::AdjustSchedulingOnAffinity(Thread* thread, u64 old_affinity_mask,
488 s32 old_core) { 487 s32 old_core) {
489 if (thread->GetSchedulingStatus() != ThreadSchedStatus::Runnable || 488 if (thread->scheduling_state != static_cast<u32>(ThreadSchedStatus::Runnable) ||
490 thread->current_priority >= THREADPRIO_COUNT) { 489 thread->current_priority >= THREADPRIO_COUNT) {
491 return; 490 return;
492 } 491 }