Procuring an Event Conditionally

A conditional procure statement allows the process to continue execution if the requested event cannot be immediately procured. The process makes one attempt to procure the event and, if the event is AVAILABLE, changes the available state to NOT AVAILABLE. The conditional procure statement returns information that enables the process to tell whether the conditional procure action was successful.

The following ALGOL statement conditionally procures the event E1 and stores the result in the Boolean variable BOOL. If the conditional procure succeeds, BOOL receives a value of FALSE. If the conditional procure fails, BOOL receives a value of TRUE.

BOOL:= FIX (E1);

The following COBOL statement conditionally procures the event E1. The AT LOCKED clause specifies an action to be taken if the procure fails.

LOCK (E1) AT LOCKED GO P2.