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

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