MacroPackage: mpToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 7.0
Moderately revised from 6.2.

with-process-lock

Arguments: (lock &key timeout norecursive seized whostate) &body body

This macro executes the body with lock seized. Unlike process-lock, with-process-lock protects against a single process trying to seize a lock it already owns. If executed dynamically inside another with-process-lock for the same lock, and if norecursive is nil, with-process-lock is a no-op. If norecursive is t, an error is signaled. The default value of norecursive is nil.

If a timeout is specified, the value should be an integer; the units are seconds. Non-positive timeout values time out immediately. If the form times out before the lock is available, the with-process-lock form returns nil without the body being executed. If you want to take specific action if the lock does not become available when timeout is specified, use a form like this:

(block ok
  (with-process-lock (lock :timeout 10)
    (return-from ok (progn body-forms ...)))
  (... action if lock never becomes available ...))

See also process-unlock, process-lock-locker, and make-process-lock.

See About design considerations for event-driven applications in cgide.htm and post-funcall-in-cg-process if you intend to call this function is a Common Graphics process.

See multiprocessing.htm for general information on multiprocessing in Allegro CL and see Process locks for more information on process locks in Allegro CL.


Copyright (c) 1998-2006, Franz Inc. Oakland, CA., USA. All rights reserved.
This page has had moderate revisions compared to the 6.2 page.
Created 2005.9.20.

ToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 7.0
Moderately revised from 6.2.