Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide

I Process Development Process
Distributed Systems Network Management (DSNM) Subsystem Interface Development
Guide109759 3-39
Altering the Current Thread Procedure and Thread
State
Altering the Current Thread Procedure and Thread State
When the frame dispatches the thread, it calls the current thread procedure. You can
alter the current thread procedure (and, in some cases, the thread state also) to be called
by the frame at the next thread dispatch by using any one of the following procedures:
_SET^THREAD^PROC
_THREAD^STATE
_PUSH^THREAD^PROCSTATE
_POP^THREAD^PROCSTATE
_DISPATCH^THREAD
_SAVE^THREAD^AND^DISPATCH
_RESTORE^THREAD^AND^DISPATCH
Altering the current thread procedure is a high-level state change. As shown in the
following example, the initial thread procedure might examine a command passed to it
by the frame when it is first dispatched. The thread procedure determines if the
command is an informational or state-change command. Since these two types of
commands have considerably different output requirements, it may be convenient to
have different procedures perform their processing.
_THREAD^PROC (info^thread^proc);
BEGIN
< procedure body >
_END^THREAD^PROC;
_THREAD^PROC (state^change^thread^proc);
BEGIN
< procedure body >
_END^THREAD^PROC;
_THREAD^PROC (_COMMAND^PROC);
BEGIN
.
.
IF info-type-command
THEN _SET^THREAD^PROC (@info^thread^proc)
ELSE _SET^THREAD^PROC (@state^change^thread^proc);
CALL _SIGNAL^EVENT (_EV^STARTUP);
RETURN _RC^WAIT;
.
.
_END^THREAD^PROC;
Setting the Current Thread Procedure: _SET^THREAD^PROC
_SET^THREAD^PROC allows you to set the thread procedure to be called by the frame
at the next thread dispatch.
_SET^THREAD^PROC ( @procname );