Implement SvcGetThreadContext3
This commit is contained in:
parent
c818093528
commit
65105c2a3b
10 changed files with 163 additions and 12 deletions
|
@ -47,6 +47,8 @@ namespace Ryujinx.HLE.OsHle.Handles
|
|||
|
||||
if (TryAddToCore(Thread))
|
||||
{
|
||||
SchedThread.IsRunning = true;
|
||||
|
||||
Thread.Thread.Execute();
|
||||
|
||||
PrintDbgThreadInfo(Thread, "running.");
|
||||
|
@ -94,10 +96,7 @@ namespace Ryujinx.HLE.OsHle.Handles
|
|||
|
||||
public void SetThreadActivity(KThread Thread, bool Active)
|
||||
{
|
||||
if (!AllThreads.TryGetValue(Thread, out SchedulerThread SchedThread))
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
SchedulerThread SchedThread = AllThreads[Thread];
|
||||
|
||||
SchedThread.IsActive = Active;
|
||||
|
||||
|
@ -111,6 +110,16 @@ namespace Ryujinx.HLE.OsHle.Handles
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsThreadRunning(KThread Thread)
|
||||
{
|
||||
if (!AllThreads.TryGetValue(Thread, out SchedulerThread SchedThread))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return SchedThread.IsRunning;
|
||||
}
|
||||
|
||||
public void EnterWait(KThread Thread, int TimeoutMs = Timeout.Infinite)
|
||||
{
|
||||
SchedulerThread SchedThread = AllThreads[Thread];
|
||||
|
@ -161,6 +170,8 @@ namespace Ryujinx.HLE.OsHle.Handles
|
|||
{
|
||||
lock (SchedLock)
|
||||
{
|
||||
AllThreads[Thread].IsRunning = false;
|
||||
|
||||
PrintDbgThreadInfo(Thread, "suspended.");
|
||||
|
||||
int ActualCore = Thread.ActualCore;
|
||||
|
@ -252,6 +263,8 @@ namespace Ryujinx.HLE.OsHle.Handles
|
|||
|
||||
private void TryResumingExecution(SchedulerThread SchedThread)
|
||||
{
|
||||
SchedThread.IsRunning = false;
|
||||
|
||||
KThread Thread = SchedThread.Thread;
|
||||
|
||||
PrintDbgThreadInfo(Thread, "trying to resume...");
|
||||
|
@ -262,6 +275,8 @@ namespace Ryujinx.HLE.OsHle.Handles
|
|||
{
|
||||
if (TryAddToCore(Thread))
|
||||
{
|
||||
SchedThread.IsRunning = true;
|
||||
|
||||
PrintDbgThreadInfo(Thread, "resuming execution...");
|
||||
|
||||
return;
|
||||
|
@ -291,6 +306,8 @@ namespace Ryujinx.HLE.OsHle.Handles
|
|||
{
|
||||
PrintDbgThreadInfo(SchedThread.Thread, "running.");
|
||||
}
|
||||
|
||||
SchedThread.IsRunning = true;
|
||||
}
|
||||
|
||||
public void Resort(KThread Thread)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue