public void SetExclusive(int core, long position) { position &= ~ErgMask; lock (_monitors) { foreach (ArmMonitor mon in _monitors.Values) { if (mon.Position == position && mon.ExState) { mon.ExState = false; } } if (!_monitors.TryGetValue(core, out ArmMonitor threadMon)) { threadMon = new ArmMonitor(); _monitors.Add(core, threadMon); } threadMon.Position = position; threadMon.ExState = true; } }
public void SetExclusive(AThreadState ThreadState, long Position) { Position &= ~ErgMask; lock (Monitors) { foreach (ArmMonitor Mon in Monitors.Values) { if (Mon.Position == Position && Mon.ExState) { Mon.ExState = false; } } if (!Monitors.TryGetValue(ThreadState.ThreadId, out ArmMonitor ThreadMon)) { ThreadMon = new ArmMonitor(); Monitors.Add(ThreadState.ThreadId, ThreadMon); } ThreadMon.Position = Position; ThreadMon.ExState = true; } }