Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide

Determining Which Event(s) Caused the Current
Dispatch
3-38
109759Distributed Systems Network Management (DSNM) Subsystem Interface
Development Guide
I Process Development Process
Determining Which Event(s) Caused the Current Dispatch
_REAL^LAST^EVENTS and _LAST^EVENTS allow the thread to determine which
event(s) caused the current dispatch.
_REAL^LAST^EVENTS
Each time the command is dispatched, _REAL^LAST^EVENTS is set to contain the
event(s) that caused the current dispatch. Each bit represents a different event.
_REAL^LAST^EVENTS is a define that returns a value; therefore it can only be tested,
not altered.
For example, to see if the thread is dispatched by a request to cancel the command:
IF _ON (_REAL^LAST^EVENTS, _EV^CANCEL)
THEN ...;
Only one frame event occurs with one dispatch per event, so only one bit of
_REAL^LAST^EVENTS is ever on for a frame event.
The thread may generate multiple simultaneous events with _SIGNAL^EVENT. All
events signaled by the thread before _RC^WAIT appear in _LAST^EVENTS at the next
thread dispatch. No frame-generated events can appear in this case.
_LAST^EVENTS
Each time the command is dispatched, _LAST^EVENTS is set to contain the event(s)
that caused the current dispatch. _LAST^EVENTS is a global variable that can be
altered as well as tested.
For example, since a command that terminates early due to a cancel event from the
frame is considered to have terminated normally, you might want to treat
_EV^CANCEL as _EV^IODONE by altering the contents of _LAST^EVENTS:
_TURNOFF (_LAST^EVENTS, _EV^CANCEL);
_TURNON (_LAST^EVENTS, _EV^IODONE);
_REAL^LAST^EVENTS
_LAST^EVENTS
Note. When a thread is invoked for the first time, _LAST^EVENTS and
_REAL^LAST^EVENTS are set to _EV^STARTUP.