Пример #1
0
        internal static WriteLockScope Create(ReaderWriterLockSlim readerWriterLock)
        {
            if (readerWriterLock == null)
            {
                throw new ArgumentNullException("readerWriterLock");
            }
            WriteLockScope writeLockScope = new WriteLockScope(readerWriterLock);

            writeLockScope.Acquire();
            return(writeLockScope);
        }
Пример #2
0
 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);
 }