public static EnterLeave section(MutexObject m) { return(new EnterLeave(delegate { m.waitForever(); }, delegate { m.release(); })); }
public static EnterLeave section(string name) { MutexObject m = new MutexObject(name); return(new EnterLeave(delegate { m.waitForever(); }, delegate { m.release(); m.Dispose(); })); }
public static EnterLeave deadSection(MutexObject m) { return(new EnterLeave(delegate { m.release(); // app > Thread.Sleep(1); // context switching // < app }, delegate { m.waitForever(); })); }