mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-19 05:36:29 +02:00
Somewhat better scheduler I guess
This commit is contained in:
parent
8df0b62fe0
commit
770cb4b655
10 changed files with 323 additions and 282 deletions
|
@ -43,10 +43,11 @@ namespace Ryujinx.OsHle.Svc
|
|||
|
||||
HThread Thread = Ns.Os.Handles.GetData<HThread>(ThreadHandle);
|
||||
|
||||
if (Ns.Os.Mutexes.TryGetValue(MutexAddress, out Mutex M))
|
||||
{
|
||||
M.GiveUpLock(ThreadHandle);
|
||||
}
|
||||
Mutex M = new Mutex(Process, MutexAddress, ThreadHandle);
|
||||
|
||||
M = Ns.Os.Mutexes.GetOrAdd(MutexAddress, M);
|
||||
|
||||
M.GiveUpLock(ThreadHandle);
|
||||
|
||||
CondVar Cv = new CondVar(Process, CondVarAddress, Timeout);
|
||||
|
||||
|
@ -54,10 +55,6 @@ namespace Ryujinx.OsHle.Svc
|
|||
|
||||
Cv.WaitForSignal(Thread);
|
||||
|
||||
M = new Mutex(Process, MutexAddress, ThreadHandle);
|
||||
|
||||
M = Ns.Os.Mutexes.GetOrAdd(MutexAddress, M);
|
||||
|
||||
M.WaitForLock(Thread, ThreadHandle);
|
||||
|
||||
ThreadState.X0 = (int)SvcResult.Success;
|
||||
|
@ -68,9 +65,11 @@ namespace Ryujinx.OsHle.Svc
|
|||
long CondVarAddress = (long)ThreadState.X0;
|
||||
int Count = (int)ThreadState.X1;
|
||||
|
||||
HThread CurrThread = Process.GetThread(ThreadState.Tpidr);
|
||||
|
||||
if (Ns.Os.CondVars.TryGetValue(CondVarAddress, out CondVar Cv))
|
||||
{
|
||||
Cv.SetSignal(Count);
|
||||
Cv.SetSignal(CurrThread, Count);
|
||||
}
|
||||
|
||||
ThreadState.X0 = (int)SvcResult.Success;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue