Esempio n. 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);
                }
            }
        }
Esempio n. 2
0
 public static void DeleteHandle(IntPtr handle)
 {
     HandleManager.DeleteHandle(handle);
 }