Beispiel #1
0
        private static SafeWaitHandle NewHandle(WaitableObject waitableObject)
        {
            IntPtr         handle         = HandleManager.NewHandle(waitableObject);
            SafeWaitHandle?safeWaitHandle = null;

            try
            {
                safeWaitHandle = new SafeWaitHandle(handle, ownsHandle: true);
                return(safeWaitHandle);
            }
            finally
            {
                if (safeWaitHandle == null)
                {
                    HandleManager.DeleteHandle(handle);
                }
            }
        }
Beispiel #2
0
 public static void DeleteHandle(IntPtr handle)
 {
     HandleManager.DeleteHandle(handle);
 }