Library / Concurrency / Synchronisation / Mutex
CLASS
Mutex
Fields 1
T data
Constructors 1
INIT(REFERENCE T initial)
Methods 3
MODIFY METHOD acquire() RETURNS voidmodifies
Block until the lock is acquired. Mirrors Lock.acquire().
Use through SYNCHRONIZED in user code — manual acquire is
the C-mutex anti-pattern (forget release, leak the lock).
MODIFY METHOD release() RETURNS voidmodifies
Release the lock. Mirrors Lock.release(). Pairs with a
previous acquire() on the same Mutex from the same thread.
MODIFY METHOD tryAcquire() RETURNS booleanmodifies
Non-blocking attempt to acquire. Mirrors Lock.tryAcquire().
Returns TRUE if the caller now holds the lock (and is
responsible for calling release() exactly once); FALSE if
another thread currently holds it.