MacroPackage: mpToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version

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 behaves as if the lock was seized successfully, and the body is executed. 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-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. This page was not revised from the 8.0 page.
Created 2009.7.29.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version