An asynchronous process depends on its initiator for global variables and call-by-name actual parameters. Thus, for each process, a critical block is present in the initiator that cannot be exited until the process is terminated. The critical block is the block of highest lexical level that contains one or more of the following items:
-
The declaration of the procedure itself
-
The declarations of the actual parameters passed to the call-by-name formal parameters
-
The declaration of the task designator
-
Any compiler-generated code for evaluating arithmetic expressions passed to call-by-name parameters
The critical block can be the block that contains the PROCESS statement, the outer block of the program, or a block in between. An attempt by the initiator to exit the critical block before the process is terminated causes the initiator and all tasks it has initiated through CALL or PROCESS statements to be terminated.
A process is terminated by exiting its own outermost block or by execution in the initiator of the following statement where the task designator specifies the task associated with the process to be terminated:
<task designator>.STATUS := VALUE(TERMINATED)
| Note: | A processed procedure must not declare an OWN array or reference another procedure that declares an OWN array. An attempt to do so results in a run-time error. A string expression cannot be passed as an actual parameter to a call-by-name parameter of a procedure in a PROCESS statement. |
When an item of a structure or connection block is used in the PROCESS or CALL statement, either as the procedure being invoked, an actual parameter passed to a call-by-name formal parameter, or the task designator, the calculation for the block that contains the highest lexical level includes the lexical level of the block that declared the structure block variable, structure block array, structure or connection block reference, or connection library used to qualify the structure or connection block item.

