System.Threading.ReaderWriterLock.ReaderWriterLock.DowngradeFromWriterLock C# (CSharp) Method

DowngradeFromWriterLock() public method

public DowngradeFromWriterLock ( LockCookie &lockCookie ) : void
lockCookie LockCookie
return void
		public void DowngradeFromWriterLock(ref LockCookie lockCookie)
		{
			lock (this) {
				if (!HasWriterLock())
					throw new ApplicationException ("The thread does not have the writer lock.");
				
				state = lockCookie.ReaderLocks;
				reader_locks [Thread.CurrentThreadId] = state;
				if (readers > 0) {
					Monitor.PulseAll (this);
				}
				
				// MSDN: A thread does not block when downgrading from the writer lock, 
				// even if other threads are waiting for the writer lock
			}
		}