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); }
public void Release(object obj) { LibUv.UvClose((IntPtr)obj, _Close_Callback); }