Macro | Package: mp | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## with-exclusive-lock

Arguments: (sharable-lock &key yield-rate timeout recursive-p) &body body

This macro was part of an early implementation of sharable locks. The values returned are not consistent with other with-XXX macros in Common Lisp. (with-exclusive-lock returns `t` rather than the value of the last body form when the associated lock is acquired.) It is included for compatibility with earlier versions. The recommended macro is with-sharable-lock.

Evaluate a body of code in the context of a `sharable-lock` acquired in exclusive mode.

The yield-rate argument, if specified, must be a positive integer, or the keyword `:never`. The specified value overrides the value in the lock instance. If the argument is omitted, or specified as `nil`, than the value in the lock instance is used.

The timeout argument, if specified, must be a non-negative number of seconds. The value determines how long the program will wait if the lock is not immediately available. A timeout value of zero specifies that that the lock must be available immediately only.

The recursive-p argument may be used to override the recursion specification in the `sharable-lock` instance. If omitted, `nil` or :default, the value in the lock instance is used. Otherwise, the value must be `t`, one of the keywors allowed in make-sharable-lock, or a list of these keywords.

The body expressions are evaluated as a progn body. If the lock is acquired, the body forms are evaluated, and the with-exclusive-lock expression returns a single value, `t`. If the lock is not acquired, the with-exclusive-lock expression returns two values as described in sharable-lock-lock.

See Sharable locks in smp.htm.

See multiprocessing.htm for general information on multiprocessing in Allegro CL.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version