ReaderWriterLockSlim.TryEnterReadLock Method (Int32)
Tries to enter the lock in read mode, with an optional integer time-out.
Assembly: System.Core (in System.Core.dll)
The recursion number would exceed the capacity of the counter. The limit is so large that applications should never encounter it.
The value of millisecondsTimeout is negative, but it is not equal to Timeout.Infinite (-1), which is the only negative value allowed.
If millisecondsTimeout is 0 (zero), this method checks the lock state and returns false immediately if the desired state is unavailable.
Multiple threads can enter read mode at the same time.
If one or more threads are waiting to enter write mode, a thread that calls the TryEnterReadLock method blocks until those threads have either timed out or entered write mode and then exited from it, or until the calling thread's own time-out interval expires.
If a lock allows recursion, a thread that has entered the lock in read mode can enter read mode recursively, even if other threads are waiting to enter write mode.
One thread can be in upgradeable mode while other threads are in read mode. If additional threads are waiting to enter upgradeable mode, and there are no threads waiting to enter write mode, threads that call the TryEnterReadLock method enter read mode immediately and do not block.
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.