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