Inheritance: System.Runtime.ConstrainedExecution.CriticalFinalizerObject
コード例 #1
0
        internal bool Unregister(WaitHandle waitObject)
        {
            bool flag = false;

            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
            }
            finally
            {
                bool flag2 = false;
                do
                {
                    if (Interlocked.CompareExchange(ref this.m_lock, 1, 0) == 0)
                    {
                        flag2 = true;
                        try
                        {
                            if (this.ValidHandle())
                            {
                                flag = RegisteredWaitHandleSafe.UnregisterWaitNative(this.GetHandle(), (waitObject == null) ? null : waitObject.SafeWaitHandle);
                                if (flag)
                                {
                                    if (this.bReleaseNeeded)
                                    {
                                        this.m_internalWaitObject.SafeWaitHandle.DangerousRelease();
                                        this.bReleaseNeeded = false;
                                    }
                                    this.SetHandle(RegisteredWaitHandleSafe.InvalidHandle);
                                    this.m_internalWaitObject = null;
                                    GC.SuppressFinalize(this);
                                }
                            }
                        }
                        finally
                        {
                            this.m_lock = 0;
                        }
                    }
                    Thread.SpinWait(1);
                }while (!flag2);
            }
            return(flag);
        }
コード例 #2
0
 internal RegisteredWaitHandle()
 {
     internalRegisteredWait = new RegisteredWaitHandleSafe();
 }
コード例 #3
0
 internal RegisteredWaitHandle()
 {
     internalRegisteredWait = new RegisteredWaitHandleSafe();
 }