Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide
Declaring Thread Procedures: _THREAD^PROC
and _END^THREAD^PROC
3-14
109759—Distributed Systems Network Management (DSNM) Subsystem Interface
Development Guide
I Process Development Process
Declaring Thread Procedures: _THREAD^PROC and
_END^THREAD^PROC
Any procedure that might be dispatched as part of a thread must be declared with
_THREAD^PROC and _END^THREAD^PROC:
_END^THREAD^PROC issues RETURN _RC^WAIT, which returns the thread to the
frame until the occurrence of the next event causes it to be redispatched. (See
“Suspending and Dispatching Thread Procedures” later in this section for more
information.)
Use _THREAD^PROC in the following constructions:
_THREAD^PROC ( procname ); EXTERNAL;
_THREAD^PROC ( procname ); FORWARD;
The Initial Command Thread Procedure: _COMMAND^PROC
The first time it dispatches an instance of the thread, the frame invokes the command
thread as _COMMAND^PROC. You must declare the initial thread procedure with
_THREAD^PROC and _END^THREAD^PROC:
_THREAD^PROC (_COMMAND^PROC);
BEGIN
< procedure body <
_END^THREAD^PROC;
The Thread Termination Procedure:
_COMMAND^TERMINATION^PROC
When a thread terminates, either because of a fatal error or because it has successfully
completed the processing of a command, the thread library looks for a user-written
procedure named _COMMAND^TERMINATION^PROC, which may be used for
cleaning up the thread’s environment. You must declare this procedure with
_THREAD^TERMINATION^PROC and _END^THREAD^TERMINATION^PROC:
_THREAD^PROC ( procname );
BEGIN
< procedure body >
_END^THREAD^PROC;
_THREAD^TERMINATION^PROC ( _COMMAND^TERMINATION^PROC );
BEGIN
< procedure body >
_END^THREAD^TERMINATION^PROC;