CMWAIT Function

The CMWAIT function may be used to wait on up to a maximum of eight events. This call provides the Com-plete dispatching nucleus with the ability to service other users while the current application waits for what should normally be a short term event. As the program cannot be rolled out over this call, the thread will be unavailable to other users. Therefore, if it is expected that the event will take longer, the ROLEVT function should be used instead.

The format for the CMWAIT function is:

CMWAIT ( retcode , ECB1 , ECB2 ......., ECB8 )
retcode A fullword containing the return code after Com-plete has processed the appropriate function.
ECB1 to ECB8 The address of the Event Control Block(s) upon which the program would like to wait. Programs which are catalogued PV may wait on up to 8 ECBs which must exist somewhere in the Com-plete address space.
Programs which are catalogued non PV may only wait on 1 ECB and this ECB must be within a previously allocated COMSTOR area. Only one ECB may exist in any one COMSTOR area.
Return Codes
0 One or more of the events has been posted complete
4 Invalid parameter list supplied One of the ECBs in the list does not exist or is not fullword aligned The same ECB address was supplied twice in the list. For OS systems, one of the ECBs had the wait bit on. A non PV user supplied more than one ECB for the request.
8 No COMSTOR available.
12 ECB provided by non PV user was not in a COMSTOR area.
16 The ECB in COMSTOR is already being waited upon
Abends

There are no abends expected with the normal usage of this function.