mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-26 09:21:21 -08:00
svc: Avoid incorrect fast yield condition
This commit is contained in:
parent
ddf5903cd9
commit
e6f7825a24
@ -960,11 +960,6 @@ static void ExitThread() {
|
|||||||
static void SleepThread(s64 nanoseconds) {
|
static void SleepThread(s64 nanoseconds) {
|
||||||
LOG_TRACE(Kernel_SVC, "called nanoseconds={}", nanoseconds);
|
LOG_TRACE(Kernel_SVC, "called nanoseconds={}", nanoseconds);
|
||||||
|
|
||||||
// Don't attempt to yield execution if there are no available threads to run,
|
|
||||||
// this way we avoid a useless reschedule to the idle thread.
|
|
||||||
if (nanoseconds <= 0 && !Core::System::GetInstance().CurrentScheduler().HaveReadyThreads())
|
|
||||||
return;
|
|
||||||
|
|
||||||
enum class SleepType : s64 {
|
enum class SleepType : s64 {
|
||||||
YieldWithoutLoadBalancing = 0,
|
YieldWithoutLoadBalancing = 0,
|
||||||
YieldWithLoadBalancing = -1,
|
YieldWithLoadBalancing = -1,
|
||||||
@ -995,7 +990,7 @@ static void SleepThread(s64 nanoseconds) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reschedule all CPU cores
|
// Reschedule all CPU cores
|
||||||
for (std::size_t i = 0; i < 4; ++i)
|
for (std::size_t i = 0; i < Core::NUM_CPU_CORES; ++i)
|
||||||
Core::System::GetInstance().CpuCore(i).PrepareReschedule();
|
Core::System::GetInstance().CpuCore(i).PrepareReschedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user