public static T Do <T>(this MiniLocker @this, Func <T> action) { @this.Enter(); try { return(action()); } finally { @this.Leave(); } }
public static void Enter(this MiniLocker @this) => @this.Enter(Timeout.InfiniteTimeSpan, CancellationToken.None);
public static void Do(this MiniLocker @this, Action action) => @this.Do(() => { action(); return(0); });