diff options
| author | 2018-11-22 00:33:53 -0500 | |
|---|---|---|
| committer | 2018-11-22 00:33:53 -0500 | |
| commit | 820d81b9a5392951c18daa5a47d6c0ffd28baa9b (patch) | |
| tree | dab20f1ff49ab76cdcd511e189799f4d6e40677e /src/core/hle/kernel/svc.cpp | |
| parent | svc: Implement yield types 0 and -1 (diff) | |
| download | yuzu-820d81b9a5392951c18daa5a47d6c0ffd28baa9b.tar.gz yuzu-820d81b9a5392951c18daa5a47d6c0ffd28baa9b.tar.xz yuzu-820d81b9a5392951c18daa5a47d6c0ffd28baa9b.zip | |
scheduler: Add explanations for YieldWith and WithoutLoadBalancing
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 467575c93..205706033 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -965,16 +965,23 @@ static void SleepThread(s64 nanoseconds) { | |||
| 965 | if (!Core::System::GetInstance().CurrentScheduler().HaveReadyThreads()) | 965 | if (!Core::System::GetInstance().CurrentScheduler().HaveReadyThreads()) |
| 966 | return; | 966 | return; |
| 967 | 967 | ||
| 968 | enum class SleepType : s64 { | ||
| 969 | YieldWithoutLoadBalancing = 0, | ||
| 970 | YieldWithLoadBalancing = 1, | ||
| 971 | YieldAndWaitForLoadBalancing = 2, | ||
| 972 | }; | ||
| 973 | |||
| 968 | if (nanoseconds <= 0) { | 974 | if (nanoseconds <= 0) { |
| 969 | switch (nanoseconds) { | 975 | auto& scheduler{Core::System::GetInstance().CurrentScheduler()}; |
| 970 | case 0: | 976 | switch (static_cast<SleepType>(nanoseconds)) { |
| 971 | GetCurrentThread()->YieldNormal(); | 977 | case SleepType::YieldWithoutLoadBalancing: |
| 978 | scheduler.YieldWithoutLoadBalancing(GetCurrentThread()); | ||
| 972 | break; | 979 | break; |
| 973 | case -1: | 980 | case SleepType::YieldWithLoadBalancing: |
| 974 | GetCurrentThread()->YieldWithLoadBalancing(); | 981 | scheduler.YieldWithLoadBalancing(GetCurrentThread()); |
| 975 | break; | 982 | break; |
| 976 | case -2: | 983 | case SleepType::YieldAndWaitForLoadBalancing: |
| 977 | GetCurrentThread()->YieldAndWaitForLoadBalancing(); | 984 | scheduler.YieldAndWaitForLoadBalancing(GetCurrentThread()); |
| 978 | break; | 985 | break; |
| 979 | default: | 986 | default: |
| 980 | UNREACHABLE_MSG( | 987 | UNREACHABLE_MSG( |