The OpenD Programming Language

Writer.tryLock

Attempts to acquire a write lock on the enclosing mutex. If one can be obtained without blocking, the lock is acquired and true is returned. If not, the function blocks until either the lock can be obtained or the time elapsed exceeds timeout, returning true if the lock was acquired and false if the function timed out.

  1. bool tryLock()
  2. bool tryLock()
  3. bool tryLock(Duration timeout)
    class Writer
    @trusted
    bool
    tryLock
  4. bool tryLock(Duration timeout)

Parameters

timeout Duration

maximum amount of time to wait for the lock

Return Value

Type: bool

true if the lock was acquired and false if not.

Meta