Ejemplo n.º 1
0
        protected override bool ReleaseHandle()
        {
            IntPtr intPtr = Interlocked.Exchange(ref handle, IntPtr.Zero);

            if (intPtr != IntPtr.Zero)
            {
                if (Thread.CurrentThread.ManagedThreadId != LoopRunThreadId)
                {
                    if (_postAsync != null)
                    {
                        HandleRelease handleRelease = new HandleRelease();
                        handleRelease.LibUv = LibUv;
                        _postAsync(new Action <object>(handleRelease.Release), intPtr);
                    }
                }
                else
                {
                    LibUv.UvClose(intPtr, _Close_Callback);
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
 public void Release(object obj)
 {
     LibUv.UvClose((IntPtr)obj, _Close_Callback);
 }