GDSX (Extended General Device Support) Manual

Service Routines
Extended General Device Support (GDSX) Manual529931-001
8-88
WAIT^EVENT
mask input
INT:value
is a bit mask specifying those events to be detected. Following are global literals
(declared in the errors section of DCCBDECS) that may be used to set bits in the
mask parameter, along with the corresponding event value returned if the event is
detected:
You can define bits 1 through 7 to create other events to be detected. If bit 0 is
turned on, all other bits in the word are considered to be turned on too. If new
events are created in this way, the WAKE^TASK procedure can be used to cause
the events on another task. See the description of the event parameter in
Table 8-2 on page 8-87 for information on what values are returned for created
events.
To determine the mask value, choose the events you wish to test for (see
Table 8-2) and then add together the corresponding literals from the preceding
DISP-list to set the mask parameter, as shown in the following example:
CALL ^READUPDATE(IN^QUEUE^FILE^NUM);
IF (EVENT := WAIT^EVENT(DISP^ITC + DISP^STOP +..)) = E^ITC
OR EVENT = E^STOP THEN
BEGIN
IF EVENT = E^ITC THEN
BEGIN
@IOCB := ^LISTEN(0,0,1);
.
process the request
.
CALL NOTIFY^IO^COMPLETION(IOCB . .);
END
ELSE
IF EVENT = E^STOP THEN
.
When more than one event is detected by WAIT^EVENT, the calling task is notified
of the masked event with the highest bit number from the DISP-list.
Mask Event Literal Binary Value Bit Number
Corresponding event
Value Returned
DISP^STOP %B1 15 1
DISP^CONTINUE %B10 14 2
DISP^CANCEL %B100 13 3
DISP^IMSG %B1000 12 4
DISP^ITC %B10000 11 5
DISP^IOC %B100000 10 6
DISP^RESOURCE %B1000000 9 7
DISP^CHANGE %B10000000 8 8