GDSX (Extended General Device Support) Manual
Service Routines
Extended General Device Support (GDSX) Manual—529931-001
8-87
WAIT^EVENT
The event descriptions and the global literals (declared in DCCBDECS(ERRORS))
used by TSCODE to define the events are listed in Table 8-2 on page 8-87. Events
having an IOCB associated with them are marked in the fourth column of the table.
After TSCODE passes a value to the task to indicate what event occurred, if the event
has an IOCB associated with it, the task can call ^LISTEN to get a pointer to the IOCB.
event returned value
INT:value
indicates a timeout or a masked event that was detected. Event is set to 0 if a
timeout occurred; otherwise, it is set to 16 minus the bit number representing the
event which occurred. See the following DISP-list for the bit numbers.
When more than one event occurred, the calling task is notified of the masked
event with the highest bit number. Therefore, when multiple events occur, multiple
calls to WAIT^EVENT are required to handle them. Each call to WAIT^EVENT
clears the event returned while retaining those of lower priority. That is, those with
lower bit numbers.
Table 8-2. Events Detected With WAIT^EVENT
Event Description Literal Identifier
Literal
Constant
Associate
d IOCB
No event: timeout occurred E^TIMEOUT 0
Request that task call STOP^TASK E^STOP 1
Resume processing E^CONTINUE 2
Intertask message or I/O canceled E^CAN 3 X
Message arrived from $RECEIVE E^IMSG 4 X
Intertask message arrived E^ITC 5 X
Completion of I/O other than $RECEIVE
and intertask message
E^IOC 6 X
Resource is available E^RESOURCE 7
Device added, deleted, altered, started, or
stopped
E^CHANGE 8
Caution. Be careful when you are programming tasks that call both WAIT^EVENT and
^AWAITIO[X], because when the two procedures are used together, ^AWAITIO[X] can “lose“
events. For an example, see the caution in the description of ^AWAITIO[X].
event := WAIT^EVENT ( mask !
i
,timeout ); !
i