public void ReacquireLocks(LockState lockState) { int writeLockCounter = lockState.writeLockCount; int readLockCounter = lockState.readLockCount; while (writeLockCounter-- > 0) { WriteLock.Lock(); } while (readLockCounter-- > 0) { ReadLock.Lock(); } }
public ReadWriteLock() { ReadLock = new ReadLock(this); WriteLock = new WriteLock(this); }