- Index
- »
- fan.concurrent
- »
- Lock
Lock
@Js
const class Lock : Obj
Lock for synchronization between actors.
Construct mutual exclusion lock
Release the lock
Acquire the lock
Acquire the lock if its free and immediately return true
Void lock()
Acquire the lock; if not available then block forever until its available.
static Lock makeReentrant()
Construct mutual exclusion lock.
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.
Void unlock()
Release the lock. Raise exception if not holding the lock.