Sdílet prostřednictvím


ReaderWriterLockSlimWrapper.TryEnterUpgradeableReadLock Method

Definition

Overloads

TryEnterUpgradeableReadLock(Int32)

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

TryEnterUpgradeableReadLock(TimeSpan)

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

TryEnterUpgradeableReadLock(Int32)

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

public:
 IDisposable ^ TryEnterUpgradeableReadLock(int millisecondsTimeout);
public IDisposable TryEnterUpgradeableReadLock (int millisecondsTimeout);
member this.TryEnterUpgradeableReadLock : int -> IDisposable
Public Function TryEnterUpgradeableReadLock (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

TryEnterUpgradeableReadLock(TimeSpan)

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

public:
 IDisposable ^ TryEnterUpgradeableReadLock(TimeSpan timeout);
public IDisposable TryEnterUpgradeableReadLock (TimeSpan timeout);
member this.TryEnterUpgradeableReadLock : TimeSpan -> IDisposable
Public Function TryEnterUpgradeableReadLock (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.

Applies to