예제 #1
0
파일: Event.cs 프로젝트: jdruin/F5Eagle
        ///////////////////////////////////////////////////////////////////////

        private /* protected virtual */ void Dispose(
            bool disposing
            ) /* throw */
        {
            if (!disposed)
            {
                if (disposing)
                {
                    ////////////////////////////////////
                    // dispose managed resources here...
                    ////////////////////////////////////

                    //
                    // NOTE: Dispose of the "done" inter-thread communication
                    //       event.
                    //
                    /* NO RESULT */
                    ThreadOps.CloseEvent(ref doneEvent);

                    //
                    // NOTE: Keep track of how many event objects are disposed
                    //       within this AppDomain.  This is applicable only
                    //       when the object is explicitly disposed, not merely
                    //       finalized.
                    //
                    Interlocked.Increment(ref disposeCount);
                }
#if DEBUG
                else
                {
                    DebugOps.MaybeBreak();
                }
#endif

                //////////////////////////////////////
                // release unmanaged resources here...
                //////////////////////////////////////

                disposed = true;
            }
        }