mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-18 08:16:39 +00:00
48278905d1
* 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
19 lines
351 B
C#
19 lines
351 B
C#
using System.Threading;
|
|
|
|
namespace Ryujinx.HLE.HOS.Kernel.Threading
|
|
{
|
|
class KThreadContext
|
|
{
|
|
private int _locked;
|
|
|
|
public bool Lock()
|
|
{
|
|
return Interlocked.Exchange(ref _locked, 1) == 0;
|
|
}
|
|
|
|
public void Unlock()
|
|
{
|
|
Interlocked.Exchange(ref _locked, 0);
|
|
}
|
|
}
|
|
}
|