DoxigAlpha

tryLock

Tries to acquire the mutex without blocking the caller's thread. Returns false if the calling thread would have to block to acquire it. Otherwise, returns true and the caller should unlock() the Mutex to release it.

Function parameters

Parameters

#
self:*Mutex

Type definitions in this namespace

Types

#

Tries to acquire the mutex without blocking the caller's thread.

Functions

#
tryLock
Tries to acquire the mutex without blocking the caller's thread.
lock
Acquires the mutex, blocking the caller's thread until it can.
unlock
Releases the mutex which was previously acquired with `lock()` or `tryLock()`.

Source

Implementation

#
pub fn tryLock(self: *Mutex) bool {
    return self.impl.tryLock();
}