An availability test returns a Boolean value that indicates whether the event is AVAILABLE. If the available state is AVAILABLE, the test returns TRUE. If the available state is NOT AVAILABLE, the test returns FALSE. The process continues normal execution in either case; it does not wait for the event to become AVAILABLE. The availability test does not make any change to the event and does not affect processes waiting on the event.
The following ALGOL statement tests the available state of the event E1:
WHILE AVAILABLE (E1) DO...
The availability test is not available in COBOL.
Note that the availability test is not an adequate substitute for the conditional procure statement. Thus, the effects of the following two statements are quite different:
FIX (E1); IF AVAILABLE (E1) THEN PROCURE (E1);
Suppose these statements are executed by a process called A. The first statement, FIX, causes a conditional procure. This statement procures event E1 if it is AVAILABLE, but abandons the procure and allows process A to continue running if E1 is NOT AVAILABLE. The second statement attempts an unconditional procure if E1 is AVAILABLE. However, there might be another process, hereafter referred to as B. Process B might procure E1 after process A executes the availability test, but before process A executes the unconditional procure. In that case, process A would cease execution until process B eventually liberated the event.
The lesson to be learned from this example is that the availability test should be used only in cases where the process does not need to procure the event, but only needs to determine whether the event is currently in use by another process. However, even this use can cause efficiency problems if done with excessive frequency. Refer to Buzz Loops later in this section for details.

