diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/Threading/KScheduler.cs')
-rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Threading/KScheduler.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/KScheduler.cs b/Ryujinx.HLE/HOS/Kernel/Threading/KScheduler.cs index e07477ae..84995513 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/KScheduler.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/KScheduler.cs @@ -199,6 +199,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading public KThread GetCurrentThread() { + return GetCurrentThreadOrNull() ?? GetDummyThread(); + } + + public KThread GetCurrentThreadOrNull() + { lock (CoreContexts) { for (int core = 0; core < CpuCoresCount; core++) @@ -210,9 +215,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading } } - return GetDummyThread(); - - throw new InvalidOperationException("Current thread is not scheduled!"); + return null; } private KThread _dummyThread; |