Liking cljdoc? Tell your friends :D

entitytxn.lock

A lock manager. Threads may lock values, waiting to obtain the lock if one is already outstanding. Locks are re-entrant and only released when fully unwound or by force.

If a lock is currently held by another thread, the current thread may wait until the lock becomes available.

A lock manager. Threads may lock values, waiting to obtain
the lock if one is already outstanding. Locks are re-entrant
and only released when fully unwound or by force.

If a lock is currently held by another thread, the current
thread may wait until the lock becomes available.
raw docstring

have-lock?clj

(have-lock? val)

Returns true if the calling thread has the lock of the specfified value, false otherwise

Returns true if the calling thread has the lock of the specfified
value, false otherwise
sourceraw docstring

lock!clj

(lock! val)
(lock! val timeout)

Attempt to lock the given value obtaining the lock if it is available or waiting the specified timeout in milliseconds otherwise. A timeout of zero means unwilling to wait; negative means wait indefinitely. Returns the value as truthy if the lock was obtained, false otherwise.

Attempt to lock the given value obtaining the lock if it is available
or waiting the specified timeout in milliseconds otherwise. A timeout
of zero means unwilling to wait; negative means wait indefinitely.
Returns the value as truthy if the lock was obtained, false otherwise.
sourceraw docstring

unlock!clj

(unlock! val)
(unlock! val force)

Unlock the value. If the lock was re-entered decrement the count unless forced, in which case unlock. When unlocking notify a single waiter, out of any that are waiting. Returns the value, throws if this thread is not the lock holder.

Unlock the value. If the lock was re-entered decrement the
count unless forced, in which case unlock. When unlocking notify
a single waiter, out of any that are waiting.
Returns the value, throws if this thread is not the lock holder.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close