ReleaseLock() публичный статический Метод

Releases the lock on the specified lockValue.
public static ReleaseLock ( int &lockValue ) : void
lockValue int [in,out] The lock value.
Результат void
Пример #1
0
        /// <summary>Releases all locks.</summary>
        /// <returns>true if it succeeds, false if it fails.</returns>
        public static bool ReleaseLocks()
        {
            EvalManager.CacheDelegate.Buckets.ToList().ForEach(x => x.ReleaseLock());
            EvalManager.CacheItem.Buckets.ToList().ForEach(x => x.ReleaseLock());
            SharedLock.ReleaseLock(ref EvalManager.SharedLock.ExpireCacheLock);

            return(true);
        }
Пример #2
0
        /// <summary>Gets the next counter.</summary>
        /// <returns>The next counter.</returns>
        public int GetNextCountAndAddParallel()
        {
            try
            {
                SharedLock.AcquireLock(ref EvalManager.SharedLock.CacheItemLock);
                Counter++;

                if (Counter == 0)
                {
                    Counter++;
                }

                return(Counter);
            }
            finally
            {
                SharedLock.ReleaseLock(ref EvalManager.SharedLock.CacheItemLock);
            }
        }
Пример #3
0
 /// <summary>Releases the lock on the shared cache.</summary>
 public void ReleaseLock()
 {
     SharedLock.ReleaseLock(ref LockValue);
 }