with-lock-timeout ( lock timeout quot -- )
Locks ยป Mutual-exclusion locks

Prev:with-lock ( lock quot -- )


Vocabulary
concurrency.locks

Inputs
locka lock
timeouta duration or f
quota quotation


Outputs
None

Word description
Calls the quotation, ensuring that only one thread executes with the lock held at a time. If another thread is holding the lock, blocks until the thread releases the lock.

Errors
Throws an error if the lock could not be acquired before the timeout expires. A timeout value of f means the thread is willing to wait indefinitely.

Definition