public void UnscheduleFutureInvocation(IKFutureSchedulerObject schedulerObj) { lock (_context.CriticalSection.Lock) { _waitingObjects.RemoveAll(x => x.Object == schedulerObj); } }
public void UnscheduleFutureInvocation(IKFutureSchedulerObject Object) { lock (_waitingObjects) { _waitingObjects.RemoveAll(x => x.Object == Object); } }
public void UnscheduleFutureInvocation(IKFutureSchedulerObject schedulerObj) { lock (_context.CriticalSection.Lock) { // Not calling TimeUp here, // TimeUp should only be called when the timeout expires, // if it expires (the scheduler object may be signaled and remove itself from the list before that happens). _waitingObjects.Remove(schedulerObj); } }
public void ScheduleFutureInvocation(IKFutureSchedulerObject schedulerObj, long timeout) { long timePoint = PerformanceCounter.ElapsedMilliseconds + ConvertNanosecondsToMilliseconds(timeout); lock (_waitingObjects) { _waitingObjects.Add(new WaitingObject(schedulerObj, timePoint)); } _waitEvent.Set(); }
public void ScheduleFutureInvocation(IKFutureSchedulerObject Object, long Timeout) { lock (WaitingObjects) { long TimePoint = Counter.ElapsedMilliseconds + ConvertNanosecondsToMilliseconds(Timeout); WaitingObjects.Add(new WaitingObject(Object, TimePoint)); } WaitEvent.Set(); }
public void ScheduleFutureInvocation(IKFutureSchedulerObject schedulerObj, long timeout) { long timePoint = PerformanceCounter.ElapsedTicks + ConvertNanosecondsToHostTicks(timeout); lock (_context.CriticalSection.Lock) { _waitingObjects.Add(new WaitingObject(schedulerObj, timePoint)); if (timeout < 1000000) { Interlocked.Exchange(ref _enforceWakeupFromSpinWait, 1); } } _waitEvent.Set(); }
public void ScheduleFutureInvocation(IKFutureSchedulerObject schedulerObj, long timeout) { long timePoint = PerformanceCounter.ElapsedMilliseconds + ConvertNanosecondsToMilliseconds(timeout); lock (_context.CriticalSection.Lock) { if (_waitingObjects.TryGetValue(schedulerObj, out var existing)) { if (timePoint < existing.TimePoint) { existing.TimePoint = timePoint; } } else { schedulerObj.TimePoint = timePoint; _waitingObjects.Add(schedulerObj); } } _waitEvent.Set(); }
public WaitingObject(IKFutureSchedulerObject schedulerObj, long timePoint) { Object = schedulerObj; TimePoint = timePoint; }
public WaitingObject(IKFutureSchedulerObject Object, long TimePoint) { this.Object = Object; this.TimePoint = TimePoint; }