Generic FunctionPackage: net.rpcToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 6.1
Unrevised

grab-gate

Arguments: home gate mark &key whostate timeout tval

This function takes possession of a gate in one atomic step. Its use is normally hidden under the above macro, but some applications may need finer control. The home argument is there to allow method specialization on the purpose of the gate. It is normally the object containing the gate. The gate argument is an instance of mp:gate (see Gates (both models) in multiprocessing.htm). If the mark argument is a list, the car of the list is updated to nil when the function is called.

If the gate is open when the function is entered, then the gate is closed, the car of the mark argument is set to t, and the gate is returned as the value of the call. The above steps are done atomically to guarantee that the closed gate was actually closed by the caller.

If the gate is closed, then it is assumed that it was closed by another process. The function waits for the gate to open and then tries to grab it as above. If the function fails to grab the gate within the timeout interval, then the value returned is tval and the car of mark remains nil.

The whostate argument is used during any wait steps. The timeout argument is a time interval in seconds.

If tval is the keyword :error, then an error is signaled if the attempt to grab the gate fails.

See also rpc.htm for general information on the Remote Procedure Call utility in Allegro CL.


Copyright (c) 1998-2001, Franz Inc. Berkeley, CA., USA. All rights reserved.
Documentation for Allegro CL version 6.1 update # 1. This page was not revised.
Created 2001.12.15.

ToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 6.1
Unrevised