acquire

abstract fun acquire(): Boolean

Attempts to acquire the lock on the lease. If the lock was not already held and the lock was successfully obtained, listeners should be notified.

Return

true if this process acquires the lease.


open fun acquire(options: AcquireOptions): Boolean

Attempts to acquire the lock on the lease with options. Implementations that do not support the requested options should fail rather than silently falling back to weaker acquire semantics, unless AcquireOptions.unsupportedWaitBehavior allows fallback.

Return

true if this process acquires the lease.