diff options
| author | TSR Berry <20988865+TSRBerry@users.noreply.github.com> | 2023-04-08 01:22:00 +0200 |
|---|---|---|
| committer | Mary <thog@protonmail.com> | 2023-04-27 23:51:14 +0200 |
| commit | cee712105850ac3385cd0091a923438167433f9f (patch) | |
| tree | 4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockContextUpdateCallback.cs | |
| parent | cd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff) | |
Move solution and projects to src
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockContextUpdateCallback.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockContextUpdateCallback.cs | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockContextUpdateCallback.cs b/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockContextUpdateCallback.cs deleted file mode 100644 index 6229f5ed..00000000 --- a/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockContextUpdateCallback.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Ryujinx.HLE.HOS.Kernel.Threading; -using System.Collections.Generic; -using System.Threading; - -namespace Ryujinx.HLE.HOS.Services.Time.Clock -{ - abstract class SystemClockContextUpdateCallback - { - private List<KWritableEvent> _operationEventList; - protected SystemClockContext _context; - private bool _hasContext; - - public SystemClockContextUpdateCallback() - { - _operationEventList = new List<KWritableEvent>(); - _context = new SystemClockContext(); - _hasContext = false; - } - - private bool NeedUpdate(SystemClockContext context) - { - if (_hasContext) - { - return _context.Offset != context.Offset || _context.SteadyTimePoint.ClockSourceId != context.SteadyTimePoint.ClockSourceId; - } - - return true; - } - - public void RegisterOperationEvent(KWritableEvent writableEvent) - { - Monitor.Enter(_operationEventList); - _operationEventList.Add(writableEvent); - Monitor.Exit(_operationEventList); - } - - private void BroadcastOperationEvent() - { - Monitor.Enter(_operationEventList); - - foreach (KWritableEvent e in _operationEventList) - { - e.Signal(); - } - - Monitor.Exit(_operationEventList); - } - - protected abstract ResultCode Update(); - - public ResultCode Update(SystemClockContext context) - { - ResultCode result = ResultCode.Success; - - if (NeedUpdate(context)) - { - _context = context; - _hasContext = true; - - result = Update(); - - if (result == ResultCode.Success) - { - BroadcastOperationEvent(); - } - } - - return result; - } - } -} |
