예제 #1
0
            public void Dispose()
            {
                if (_mutex != null)
                {
                    _mutex.Dispose();
                    _mutex = null;

                    _messagePostEvent.Dispose();
                    _messagePostEvent = null;
                }
            }
예제 #2
0
        public static EnterLeave section(string name)
        {
            MutexObject m = new MutexObject(name);

            return(new EnterLeave(delegate
            {
                m.waitForever();
            },
                                  delegate
            {
                m.release();
                m.Dispose();
            }));
        }