Exemplo n.º 1
0
 public void UnscheduleFutureInvocation(IKFutureSchedulerObject schedulerObj)
 {
     lock (_context.CriticalSection.Lock)
     {
         _waitingObjects.RemoveAll(x => x.Object == schedulerObj);
     }
 }
Exemplo n.º 2
0
 public void UnscheduleFutureInvocation(IKFutureSchedulerObject Object)
 {
     lock (_waitingObjects)
     {
         _waitingObjects.RemoveAll(x => x.Object == Object);
     }
 }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
        public void ScheduleFutureInvocation(IKFutureSchedulerObject schedulerObj, long timeout)
        {
            long timePoint = PerformanceCounter.ElapsedMilliseconds + ConvertNanosecondsToMilliseconds(timeout);

            lock (_waitingObjects)
            {
                _waitingObjects.Add(new WaitingObject(schedulerObj, timePoint));
            }

            _waitEvent.Set();
        }
Exemplo n.º 5
0
        public void ScheduleFutureInvocation(IKFutureSchedulerObject Object, long Timeout)
        {
            lock (WaitingObjects)
            {
                long TimePoint = Counter.ElapsedMilliseconds + ConvertNanosecondsToMilliseconds(Timeout);

                WaitingObjects.Add(new WaitingObject(Object, TimePoint));
            }

            WaitEvent.Set();
        }
Exemplo n.º 6
0
        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();
        }
Exemplo n.º 7
0
        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();
        }
Exemplo n.º 8
0
 public WaitingObject(IKFutureSchedulerObject schedulerObj, long timePoint)
 {
     Object    = schedulerObj;
     TimePoint = timePoint;
 }
Exemplo n.º 9
0
 public WaitingObject(IKFutureSchedulerObject Object, long TimePoint)
 {
     this.Object    = Object;
     this.TimePoint = TimePoint;
 }