internal static WriteLockScope Create(ReaderWriterLockSlim readerWriterLock) { if (readerWriterLock == null) { throw new ArgumentNullException("readerWriterLock"); } WriteLockScope writeLockScope = new WriteLockScope(readerWriterLock); writeLockScope.Acquire(); return(writeLockScope); }
internal WriteLockScope Upgrade() { if (base.IsDisposed) { throw new ObjectDisposedException(base.GetType().Name); } if (!this.lockChanged && !this.upgradeableReadLockExited) { this.lockChanged = true; return(WriteLockScope.Create(base.ScopedReaderWriterLock)); } return(null); }