Beispiel #1
0
        public void SetInterval(long nsec)
        {
            var tm = new timespec
            {
                tv_sec  = (int)(nsec / 1_000_000_000L),
                tv_nsec = (int)(nsec % 1_000_000_000L)
            };
            var newValue = new itimerspec
            {
                it_value    = tm,
                it_interval = tm
            };

            Interops.timerfd_settime(this.Identity, 0, ref newValue, out var dummy);
        }
Beispiel #2
0
 void IEPollListener.OnRaised()
 {
     Interops.timerfd_read(this.Identity, out var timerData, (UIntPtr)(sizeof(ulong)));
     Raised();
 }
Beispiel #3
0
 protected Timer()
     : base(Interops.timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK))
 {
 }
Beispiel #4
0
 void IEPollListener.OnRaised()
 {
     Interops.eventfd_read(this.Identity, out var value);
     Received();
 }
Beispiel #5
0
 public void Pulse()
 {
     Interops.eventfd_write(this.Identity, 1);
 }
Beispiel #6
0
 protected Event()
     : base(Interops.eventfd(0, EFD_NONBLOCK | EFD_SEMAPHORE))
 {
 }