TryEnterReadLock Method

ReaderWriterLockSlim.TryEnterReadLock Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Tries to enter the lock in read mode, with an optional time-out.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method TryEnterReadLock(Int32) Tries to enter the lock in read mode, with an optional integer time-out.
Public method TryEnterReadLock(TimeSpan) Tries to enter the lock in read mode, with an optional time-out.
Top

Caution noteCaution:

Do not use ReaderWriterLockSlim. It throws a MethodAccessException exception when two readers enter the lock. In most cases, use the Monitor class instead.

Show:
© 2017 Microsoft