internal float CompareWith(LockGroup lockGroup) { float sum = 0; SortedSet <LockState> Except = this.LockStates; Except.ExceptWith(lockGroup.LockStates); foreach (LockState ls in Except) { sum += ls.Size; } return(sum); }
public LockRequest(TimeSpan Timeout, Action<LockRequest> Acquired, LockGroup lockGroup) { if (Acquired == null) throw new ArgumentNullException ("Acquired"); if (lockGroup == null) throw new ArgumentNullException ("lockGroup"); acquired = Acquired; timeout = Timeout; this.lockGroup = lockGroup; timeRequested = DateTime.UtcNow; timeAcquired = DateTime.MinValue; }
public LockRequest(TimeSpan Timeout, Action <LockRequest> Acquired, LockGroup lockGroup) { if (Acquired == null) { throw new ArgumentNullException("Acquired"); } if (lockGroup == null) { throw new ArgumentNullException("lockGroup"); } acquired = Acquired; timeout = Timeout; this.lockGroup = lockGroup; timeRequested = DateTime.UtcNow; timeAcquired = DateTime.MinValue; }
internal void TryAcquire(LockGroup Group) { lock (lock_status) { if (Status == LockStatus.Unlocked) { lock (lockManager.LockAccess) { foreach (var LockState in lockManager.Locks) { if (LockState.Key != this) { if (!LockState.Key.CanCoexistWith(this)) { return; } } } if (VerifyObjects()) { stateChanged(this); } } } } }
internal float CompareWith(LockGroup lockGroup) { float sum = 0; SortedSet<LockState> Except = this.LockStates; Except.ExceptWith (lockGroup.LockStates); foreach (LockState ls in Except) { sum += ls.Size; } return sum; }
internal override void Schedule(LockGroup lockGroup) { throw new NotImplementedException(); }
internal abstract void Schedule(LockGroup lockGroup);
internal override void Schedule(LockGroup lockGroup) { lock (LGs) { LGs.Add(lockGroup); } }
internal override void Schedule(LockGroup lockGroup) { lock (LGs) LGs.Enqueue(lockGroup); }
internal void TryAcquire(LockGroup Group) { lock (lock_status) { if (Status == LockStatus.Unlocked) { lock (lockManager.LockAccess) { foreach (var LockState in lockManager.Locks) { if (LockState.Key != this) if (!LockState.Key.CanCoexistWith (this)) { return; } } if (VerifyObjects ()) { stateChanged (this); } } } } }