public void Dispose() { if (_mutex != null) { _mutex.Dispose(); _mutex = null; _messagePostEvent.Dispose(); _messagePostEvent = null; } }
public static EnterLeave section(string name) { MutexObject m = new MutexObject(name); return(new EnterLeave(delegate { m.waitForever(); }, delegate { m.release(); m.Dispose(); })); }