Exemplo n.º 1
0
        public static void WithLock <T>(ExclusiveLock @lock, Action <T> action, T state)
        {
            @lock.Lock();

            try
            {
                action(state);
            }
            finally
            {
                @lock.Unlock();
            }
        }
Exemplo n.º 2
0
 public static void WithLock <T>(ExclusiveLock @lock, Action <T> action) where T : class
 {
     WithLock(@lock, action, null);
 }