Waits for a specified amount of time in any application where a time interval is desired between events. It should be used in place of timing loops to wait for an event to occur.
This function requires no prerequisite calls to other functions.
hllc (func, apistring, len, ret) int *func; char *apistring; int *len; int *ret;
Supply the following parameters to invoke the PAUSE function:
ret | The following codes are valid:
|
The PAUSE function has several options associated with it. To use the IPAUSE option for a specific session when multiple sessions are being monitored by the START HOST NOTIFICATION (23) function, place the short session ID of the session for which IPAUSE has been requested in the first position of the data string. As a result, the call to the PAUSE function will return only when an event on the specified session has occurred or the PAUSE function has timed out. For example, host events on other sessions will not cause an interruption of the PAUSE function.
Once a PAUSE function call has been satisfied by a host event, the QUERY HOST UPDATE (24) function should be called before PAUSE function is called again. All subsequent calls to the PAUSE function will return immediately with a return code of 26 until the QUERY HOST UPDATE (24) function is complete.
Applications that require a high-resolution timer should not use the PAUSE function. The time interval created by this function is approximate. The FPAUSE or IPAUSE option in the SET SESSION PARAMETERS (9) function affects the length of the pause that occurs when you call this function.
When a START function is called, the IPAUSE option can be used to make the application wait until the host PS or Operator Information Area (OIA), or both, has received an update. The PAUSE function terminates when this occurs and allows the application to issue a query function to determine what changed. The application can then issue a SEARCH PRESENTATION SPACE (6) function call to see if the expected update occurred.
If the START HOST NOTIFICATION (23) function is not enabled, the PAUSE function will wait for a specific amount of time and return to the application with return code 0.
The PAUSE function can be ended by a host event if a prior START HOST NOTIFICATION (23) function has been called. To interrupt the PAUSE application whenever the PS has been updated, set the IPAUSE option in conjunction with the enabling of the START HOST NOTIFICATION (23) function.
The IPAUSE option is used in conjunction with the following three functions to allow a HLLAPI application to determine if the designated host PS or OIA has been updated:
When using the FPAUSE option, the specified time interval will not be interrupted if a host update occurs before the interval expires. The FPAUSE option is the default.
QUERY HOST UPDATE (24) function, START HOST NOTIFICATION (23) function and STOP HOST NOTIFICATION (25) function.