diff options
author | gdkchan <gab.dark.100@gmail.com> | 2020-05-04 00:41:29 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 13:41:29 +1000 |
commit | 15d1cc806b1b978bab83d8bb426a124d9f0f788c (patch) | |
tree | 4fd10fdd11412bafcf3022e7cc4eb21179eef1b1 /Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs | |
parent | cd48576f5846aa89a36bfc833e9de5dde9627aed (diff) |
Move kernel state out of the Horizon class (#1107)
* Move kernel state from Horizon to KernelContext
* Merge syscalls partial classes, split 32 and 64-bit variants
* Sort usings
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs')
-rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs b/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs index a7955d7a..91501a98 100644 --- a/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs +++ b/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs @@ -8,17 +8,17 @@ namespace Ryujinx.HLE.HOS.Kernel.Common { private const int Time10SecondsMs = 10000; - private long[] _current; - private long[] _limit; - private long[] _available; + private readonly long[] _current; + private readonly long[] _limit; + private readonly long[] _available; - private object _lockObj; + private readonly object _lockObj; - private LinkedList<KThread> _waitingThreads; + private readonly LinkedList<KThread> _waitingThreads; private int _waitingThreadsCount; - public KResourceLimit(Horizon system) : base(system) + public KResourceLimit(KernelContext context) : base(context) { _current = new long[(int)LimitableResource.Count]; _limit = new long[(int)LimitableResource.Count]; @@ -57,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Common { _waitingThreadsCount++; - KConditionVariable.Wait(System, _waitingThreads, _lockObj, timeout); + KConditionVariable.Wait(KernelContext, _waitingThreads, _lockObj, timeout); _waitingThreadsCount--; @@ -101,7 +101,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Common if (_waitingThreadsCount > 0) { - KConditionVariable.NotifyAll(System, _waitingThreads); + KConditionVariable.NotifyAll(KernelContext, _waitingThreads); } } } |