class

Lock

@Js
const class Lock : Obj

Lock for synchronization between actors.

methods makeReentrant

Construct mutual exclusion lock

unlock

Release the lock

lock

Acquire the lock

tryLock

Acquire the lock if its free and immediately return true

lock Void lock()

Acquire the lock; if not available then block forever until its available.

makeReentrant static Lock makeReentrant()

Construct mutual exclusion lock.

tryLock Bool tryLock(Duration? timeout)

Acquire the lock if its free and immediately return true. Or if the lock is not available and timeout is null, then immediately return false. If timeout is non-null, then block up to the given timeout waiting for the lock and return true if lock acquired or false on timeout.

unlock Void unlock()

Release the lock. Raise exception if not holding the lock.

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST