InterprocessReaderWriterLockTryEnterWriteLock Method
Tries to enter the lock in write mode, with an optional time-out.
Namespace: Gemstone.ThreadingAssembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.166 -- Release Build+d3cb24a90fe44346300dfbb17444d7b350f42d79
public bool TryEnterWriteLock(
int millisecondsTimeout
)
Public Function TryEnterWriteLock (
millisecondsTimeout As Integer
) As Boolean
public:
bool TryEnterWriteLock(
int millisecondsTimeout
)
function TryEnterWriteLock(millisecondsTimeout);
- millisecondsTimeout Int32
- The number of milliseconds to wait, or -1 (Infinite) to wait indefinitely.
Booleantrue if the calling thread entered write mode, otherwise,
false.
Upon successful acquisition of a write lock, use the finally block of a try/finally statement to call ExitWriteLock.
One ExitWriteLock should be called for each EnterWriteLock or TryEnterWriteLock(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.