|
InterprocessReaderWriterLockTryEnterReadLock Method
|
Tries to enter the lock in read mode, with an optional time-out.
Namespace: GSF.ThreadingAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax public bool TryEnterReadLock(
int millisecondsTimeout
)
Public Function TryEnterReadLock (
millisecondsTimeout As Integer
) As Boolean
public:
bool TryEnterReadLock(
int millisecondsTimeout
)
member TryEnterReadLock :
millisecondsTimeout : int -> bool
function TryEnterReadLock(millisecondsTimeout);
View SourceParameters
- millisecondsTimeout Int32
- The number of milliseconds to wait, or -1 (Infinite) to wait indefinitely.
Return Value
Booleantrue if the calling thread entered read mode, otherwise,
false.
Remarks
Upon successful acquisition of a read lock, use the finally block of a try/finally statement to call ExitReadLock.
One ExitReadLock should be called for each EnterReadLock or TryEnterReadLock(Int32).
Note that this function may wait as long as 2 * millisecondsTimeout since the function first waits for synchronous access
to the semaphore, then waits again on an available semaphore slot.
See Also