public static AcquireLock ( int &lockValue ) : void | ||
lockValue | int | [in,out] The lock value. |
Результат | void |
/// <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); } }
/// <summary>Acquires the lock on the shared cache.</summary> public void AcquireLock() { SharedLock.AcquireLock(ref LockValue); }