EVENT WAIT statement
Standard: F77 F90 F95 F2003 F2008 F2018 Example program
<Syntax>
EVENT WAIT ( event-variable [ , wait-spec ]... )
| wait-spec | ::= | ERRMSG = errmsg-variable |
| | | STAT = stat-variable | |
| | | UNTIL_COUNT = scalar-integer-expr |
The event-variable must be of type EVENT_TYPE from the intrinsic module ISO_FORTRAN_ENV.
This variable must not be a coindexed object, that is, an image can only wait for events posted to its own event variables.
At most one of each kind of wait-spec is allowed. A stat-variable must be a non-coindexed scalar Integer variable, and should be able to support values from −9999 to +9999, i.e. it should be at least 16 bits. An errmsg-variable must be a non-coindexed default Character variable.
<Semantics>
Execution of an EVENT WAIT statement waits until the event-variable's “event count” has reached the “threshold value”.
The threshold value is one if the UNTIL_COUNT= specifier does not appear, or if the scalar-integer-expr is less than one; otherwise it is equal to the scalar-integer-expr.
When the wait is satisfied, the event count is then decreased by the threshold value.
Synchronisation is one-sided: the segments after execution of EVENT WAIT follow the segments before the corresponding EVENT POST execution(s).
If STAT= appears, it is assigned the value zero if the wait was successful, and a positive value if any error occurred.
If an error occurs and STAT= does not appear, the program is terminated.
If both STAT= and ERRMSG= appear, and any error occurs, an explanatory message is assigned to the errmsg-variable.
<Related>
ERRMSG= specifier, EVENT POST statement, Image control statements, STAT= specifier