Terminate the execution of a thread.
CS_RETCODE srv_termproc(spp)
SRV_PROC *spp;
A pointer to an internal thread control structure.
Returns |
To indicate |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
#include <ospublic.h>
/*
** Local Prototype.
*/
CS_RETCODE ex_srv_termproc PROTOTYPE((
SRV_PROC *spp
));
/*
** EX_SRV_TERMPROC
**
** Example routine to terminate the execution of a thread using
** srv_termproc.
**
** Arguments:
** spp A pointer to an internal thread control structure.
** Returns:
**
** CS_SUCCEED Thread successfully terminated
** CS_FAIL An error was detected.
*/
CS_RETCODE ex_srv_termproc(spp)
SRV_PROC *spp;
{
/*
** Terminate the thread.
*/
if (srv_termproc(spp) != CS_SUCCEED)
{
return(CS_FAIL);
}
return(CS_SUCCEED);
}
Using srv_createproc, Open Server applications can create event driver threads that are not associated with a client connection.
srv_termproc cannot be used in a SRV_START handler.
Do not call srv_termproc from interrupt level code; the results are unpredictable.
Mutexes, mutex locks, registered procedures, queued events, and messages associated with a thread are destroyed when the thread terminates.
The following code fragment illustrates the use of srv_termproc: