Beispiel #1
0
 public int Guard()
 {
     using (var guard = list.Lock())
     {
         return(guard.Value.FirstOrDefault());
     }
 }
Beispiel #2
0
 public void Bar(int z)
 {
     // alternative style
     using (var guard = state.Lock())
     {
         guard.Value.X -= 1;
         guard.Value.Y -= z;
     }
 }