GDSX (Extended General Device Support) Manual

Service Routines
Extended General Device Support (GDSX) Manual529931-001
8-86
WAIT^EVENT
specifies the number of bytes to write.
readcount input
INT:value
specifies the number of bytes to read.
countxfered output
is a pointer to the number of bytes transferred. The number of bytes is passed by
AWAITIO[X], which is used to implement this procedure.
timeout input
INT(32):value
specifies the number of ticks (10 ms) to wait for the I/O to complete.
Consideration
The procedure sets condition codes in the same manner as AWAITIO. ^FILEINFO
may be called to retrieve error information.
WAIT^EVENT
Instead of using ^AWAITIO[X], which tests only for I/O completions, a multithreaded
DEVICE^HANDLER or LINE^HANDLER task uses the WAIT^EVENT procedure to
check for I/O completions and other asynchronous events. When you specify a set of
event types to look for, WAIT^EVENT returns an indication of which of those types of
events has occurred. The ^LISTEN procedure can then be used to get the address of
any associated IOCB, which in turn can be used to locate the message buffer (as was
done in the control block tracing exercise in Section 5, DEVICE^HANDLER Example,
Design). TSCODE does not automatically move data from an IOCB to a message
buffer when WAIT^EVENT is called as it does when ^READUPDATE is called on a
pseudo-$RECEIVE file.
When the WAIT^EVENT procedure is called, control is transferred to TSCODE, which
checks to see if certain events have occurred. The events to be checked are specified
in a bit-encoded mask passed to TSCODE along with a timeout parameter. If one of
these events occurs within the timeout period, TSCODE awakens the calling task and
returns the lowest numbered masked event that has occurred (see the third column of
Table 8-1 on page 8-5). Each call to WAIT^EVENT clears the event returned while
retaining those of lower priority That is, those with higher event numbers.
INT:ref (use with WAITED^IO.)
INT .EXT:ref (use with WAITED^IOX.)