GDSX Manual

Service Routines
Extended General Device Support (GDSX) Manual134303
8-86
WAIT^EVENT
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.
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
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
Table 8-2. Events Detected With WAIT^EVENT
Event Description Literal Identifier
Literal
Constant
Associated
IOCB