Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide
DSNM Library Services
Distributed Systems Network Management (DSNM) Subsystem Interface Development 
Guide—109759 A-111
_SET^THREAD^PROC
_SET^THREAD^PROC
_SET^THREAD^PROC sets the current thread procedure to be called by the frame at 
the next thread dispatch. 
procname input 
is the name of the thread procedure called by the frame at the next thread dispatch.
Considerations
•
Setting the current thread procedure is a high-level state change. For instance, the 
initial thread procedure (_COMMAND^PROC) might examine the command passed 
to it by the frame (when first dispatched) to determine if it is an informational 
command or a state-change command.  Since these commands have considerably 
different output requirements, it may be convenient to have different procedures 
perform their processing (see the provided example).
•
The current thread procedure and thread state may be saved and later restored with 
combinations of _DISPATCH^THREAD, _PUSH^THREAD^PROCSTATE, 
_POP^THREAD^PROCSTATE, _SAVE^THREAD^AND^DISPATCH, and 
_RESTORE^THREAD^AND^DISPATCH.
Example
The following example causes the thread procedure selected for the command type to be 
dispatched immediately with the event _EV^STARTUP:
_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;
_SET^THREAD^PROC ( @procname );










