Ejemplo n.º 1
0
        public void DispatchAfter(DispatchTime when, Action action)
        {
            if (action == null)
            {
                throw new ArgumentNullException("action");
            }

            dispatch_after_f(when.Nanoseconds, Handle, (IntPtr)GCHandle.Alloc(Tuple.Create(action, this)), static_dispatch);
        }
Ejemplo n.º 2
0
        public void DispatchAfter(DispatchTime when, DispatchBlock block)
        {
            if (block == null)
            {
                throw new ArgumentNullException(nameof(block));
            }

            dispatch_after(when.Nanoseconds, GetCheckedHandle(), block.GetCheckedHandle());
        }
Ejemplo n.º 3
0
 public bool Wait(DispatchTime timeout)
 {
     return(dispatch_group_wait(GetCheckedHandle(), timeout.Nanoseconds) == 0);
 }
Ejemplo n.º 4
0
 public DispatchTime(DispatchTime when, TimeSpan delta) : this()
 {
     Nanoseconds = dispatch_time(when.Nanoseconds, delta.Ticks * 100);
 }
Ejemplo n.º 5
0
 public DispatchTime(DispatchTime when, long deltaNanoseconds)
     : this()
 {
     Nanoseconds = dispatch_time(when.Nanoseconds, deltaNanoseconds);
 }
Ejemplo n.º 6
0
 public nint Wait(DispatchTime time)
 {
     return(dispatch_block_wait(GetCheckedHandle(), time));
 }
Ejemplo n.º 7
0
 extern static nint dispatch_block_wait(IntPtr block, DispatchTime time);
Ejemplo n.º 8
0
 public void SetTimer(DispatchTime time, long nanosecondInterval, long nanosecondLeeway)
 {
     dispatch_source_set_timer(GetCheckedHandle(), time.Nanoseconds, nanosecondInterval, nanosecondLeeway);
 }
Ejemplo n.º 9
0
 public void SetTimer(DispatchTime time, long nanosecondInterval, long nanosecondLeeway)
 {
     Check();
     dispatch_source_set_timer(handle, time.Nanoseconds, nanosecondInterval, nanosecondLeeway);
 }
Ejemplo n.º 10
0
 public bool Wait(DispatchTime timeout)
 {
     Check();
     return(dispatch_group_wait(handle, timeout.Nanoseconds) == 0);
 }