Rewrite scheduler context switch code (#1786)
* Rewrite scheduler context switch code * Fix race in UnmapIpcRestorePermission * Fix thread exit issue that could leave the scheduler in a invalid state * Change context switch method to not wait on guest thread, remove spin wait, use SignalAndWait to pass control * Remove multi-core setting (it is always on now) * Re-enable assert * Remove multicore from default config and schema * Fix race in KTimeManager
This commit is contained in:
parent
3484265d37
commit
48278905d1
37 changed files with 1080 additions and 1160 deletions
|
@ -82,9 +82,6 @@ namespace Ryujinx.HLE.HOS
|
|||
|
||||
public Keyset KeySet => Device.FileSystem.KeySet;
|
||||
|
||||
#pragma warning disable CS0649
|
||||
private bool _hasStarted;
|
||||
#pragma warning restore CS0649
|
||||
private bool _isDisposed;
|
||||
|
||||
public bool EnablePtc { get; set; }
|
||||
|
@ -300,22 +297,6 @@ namespace Ryujinx.HLE.HOS
|
|||
VsyncEvent.ReadableEvent.Signal();
|
||||
}
|
||||
|
||||
public void EnableMultiCoreScheduling()
|
||||
{
|
||||
if (!_hasStarted)
|
||||
{
|
||||
KernelContext.Scheduler.MultiCoreScheduling = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void DisableMultiCoreScheduling()
|
||||
{
|
||||
if (!_hasStarted)
|
||||
{
|
||||
KernelContext.Scheduler.MultiCoreScheduling = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
|
@ -346,9 +327,7 @@ namespace Ryujinx.HLE.HOS
|
|||
}
|
||||
|
||||
// Exit ourself now!
|
||||
KernelContext.Scheduler.ExitThread(terminationThread);
|
||||
KernelContext.Scheduler.GetCurrentThread().Exit();
|
||||
KernelContext.Scheduler.RemoveThread(terminationThread);
|
||||
KernelStatic.GetCurrentThread().Exit();
|
||||
});
|
||||
|
||||
terminationThread.Start();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue