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

TryEnterReadLock() public method

public TryEnterReadLock ( TimeSpan timeout ) : bool
timeout TimeSpan
return bool
		public bool TryEnterReadLock (TimeSpan timeout)
		{
			return TryEnterReadLock (CheckTimeout (timeout));
		}

Same methods

ReaderWriterLockSlim::TryEnterReadLock ( int millisecondsTimeout ) : bool

Usage Example

Example #1
0
 public ReadOnlyLock(ReaderWriterLockSlim rwl, int millisecondsTimeout)
     : base(rwl)
 {
     if (millisecondsTimeout == Timeout.Infinite)
     {
         while (!_lockAcquired)
             _lockAcquired = rwl.TryEnterReadLock(1);
     }
     else
     {
         _lockAcquired = rwl.TryEnterReadLock(millisecondsTimeout);
     }
 }
All Usage Examples Of System.Threading.ReaderWriterLockSlim::TryEnterReadLock