Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide
DSNM Library Services
Distributed Systems Network Management (DSNM) Subsystem Interface Development
Guide—109759 A-107
_SAVE^THREAD^AND^DISPATCH
_SAVE^THREAD^AND^DISPATCH
_SAVE^THREAD^AND^DISPATCH saves the current thread procedure and state,
optionally sets new current thread procedure and state values, and returns to the frame
for immediate dispatch.
procname input
is the dispatched thread procedure. This procedure becomes the new current thread
procedure. The default is to redispatch the existing current thread procedure.
state input
INT: value
is an INT expression that designates what becomes the current thread state when the
specified thread is dispatched. The default is to keep the existing current state.
event input
INT:value
is an INT expression that designates the event(s) with which the new procedure is
dispatched. The default is _EV^CONTINUE.
When using _SAVE^THREAD^AND^DISPATCH with all arguments omitted
(accepting all the defaults), you must use the following construction:
_SAVE^THREAD^AND^DISPATCH ( );
_SAVE^THREAD^AND^DISPATCH can fail only with the error
ZDSN^ERR^MEMORY. When a failure occurs, code immediately following the
function is executed.
Example
IF _ON (inobj.cf, c^info) THEN
BEGIN
! Set state where we wish to return to this proc.
_THREAD^STATE := st^done;
_SAVE^THREAD^AND^DISPATCH (@info^proc, st^new^object,
_EV^STARTUP);
! If _SAVE^THREAD^AND^DISPATCH fails,
! we fall through to here and ...
RETURN _RC^ABORT (ZDSN^ERR^MEMORY);
END;
_SAVE^THREAD^AND^DISPATCH ( [ @procname ]
,[ state ]
,[ event ] );