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

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