Browse Source

Move prio/core locals inside the lock on yield (#478)

gdkchan 7 years ago
parent
commit
2fd23577ce
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Ryujinx.HLE/HOS/Kernel/KThread.cs

+ 2 - 2
Ryujinx.HLE/HOS/Kernel/KThread.cs

@@ -226,11 +226,11 @@ namespace Ryujinx.HLE.HOS.Kernel
 
 
         public void YieldWithLoadBalancing()
         public void YieldWithLoadBalancing()
         {
         {
+            System.CriticalSectionLock.Lock();
+
             int Prio = DynamicPriority;
             int Prio = DynamicPriority;
             int Core = CurrentCore;
             int Core = CurrentCore;
 
 
-            System.CriticalSectionLock.Lock();
-
             if (SchedFlags != ThreadSchedState.Running)
             if (SchedFlags != ThreadSchedState.Running)
             {
             {
                 System.CriticalSectionLock.Unlock();
                 System.CriticalSectionLock.Unlock();