ReaderWriterLockSlimWrapper.TryEnterWriteLock Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
TryEnterWriteLock(Int32) |
Tries to enter the lock in write mode, with an optional integer time-out. |
TryEnterWriteLock(TimeSpan) |
Tries to enter the lock in write mode, with an optional integer time-out. |
TryEnterWriteLock(Int32)
Tries to enter the lock in write mode, with an optional integer time-out.
public:
IDisposable ^ TryEnterWriteLock(int millisecondsTimeout);
public IDisposable TryEnterWriteLock (int millisecondsTimeout);
member this.TryEnterWriteLock : int -> IDisposable
Public Function TryEnterWriteLock (millisecondsTimeout As Integer) As IDisposable
Parameters
- millisecondsTimeout
- Int32
The number of milliseconds to wait, or -1 (System.Threading.Timeout.Infinite) to wait indefinitely.
Returns
If the lock was successfully entered, the return value is an object that will exit the lock when disposed. If the lock was not entered, null is returned.
Applies to
TryEnterWriteLock(TimeSpan)
Tries to enter the lock in write mode, with an optional integer time-out.
public:
IDisposable ^ TryEnterWriteLock(TimeSpan timeout);
public IDisposable TryEnterWriteLock (TimeSpan timeout);
member this.TryEnterWriteLock : TimeSpan -> IDisposable
Public Function TryEnterWriteLock (timeout As TimeSpan) As IDisposable
Parameters
- timeout
- TimeSpan
The interval to wait, or -1 milliseconds to wait indefinitely.
Returns
If the lock was successfully entered, the return value is an object that will exit the lock when disposed. If the lock was not entered, null is returned.