System.Threading.ReaderWriterLockSlim.ExitReadLock C# (CSharp) Method

ExitReadLock() public method

public ExitReadLock ( ) : void
return void
		public void ExitReadLock ()
		{
			EnterMyLock ();

			if (owners < 1) {
				ExitMyLock ();
				throw new SynchronizationLockException ("Releasing lock and no read lock taken");
			}

			--owners;
			--GetReadLockDetails (Thread.CurrentThread.ManagedThreadId, false).ReadLocks;

			ExitAndWakeUpAppropriateWaiters ();
		}

Usage Example

Example #1
0
 public bool TryGetEntity(UUID id, out ISceneEntity entity)
 {
     // Standard thread-safe lookup
     m_syncRoot.EnterReadLock();
     try
     {
         return(m_entityUUIDs.TryGetValue(id, out entity));
     }
     finally { m_syncRoot.ExitReadLock(); }
 }
All Usage Examples Of System.Threading.ReaderWriterLockSlim::ExitReadLock