Esempio n. 1
0
        override protected bool ReleaseHandle()
        {
#if MONO
            NativeEventCalls.CloseEvent_internal(handle);
            return(true);
#else
#if !FEATURE_CORECLR
            if (!bIsMutex || Environment.HasShutdownStarted)
            {
                return(Win32Native.CloseHandle(handle));
            }

            bool bReturn        = false;
            bool bMutexObtained = false;
            try
            {
                if (!bIsReservedMutex)
                {
                    Mutex.AcquireReservedMutex(ref bMutexObtained);
                }
                bReturn = Win32Native.CloseHandle(handle);
            }
            finally
            {
                if (bMutexObtained)
                {
                    Mutex.ReleaseReservedMutex();
                }
            }
            return(bReturn);
#else
            return(Win32Native.CloseHandle(handle));
#endif
#endif
        }
Esempio n. 2
0
        override protected bool ReleaseHandle()
        {
#if MONO
            NativeEventCalls.CloseEvent_internal(handle);
            return(true);
#else
            return(Win32Native.CloseHandle(handle));
#endif
        }
Esempio n. 3
0
        public virtual IMessage SyncProcessMessage(IMessage msg)
        {
            reply_message = msg;

            completed = true;
            NativeEventCalls.SetEvent_internal(handle.Handle);

            if (async_callback != null)
            {
                AsyncCallback ac = (AsyncCallback)async_callback;
                ac(this);
            }

            return(null);
        }
 protected override bool ReleaseHandle()
 {
     NativeEventCalls.CloseEvent_internal(this.handle);
     return(true);
 }