Back to home page

Enduro/X

 
 

    


0001 TPEXIT(3)
0002 =========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tpexit - Terminate server process
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014 
0015 void tpexit(void);
0016 
0017 
0018 For XATMI client link with '-latmiclt -latmi -lubf -lnstd -lpthread -lrt -lm'
0019 
0020 For XATMI server link with '-latmisrv|-latmisrvnomain|-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm'
0021 
0022 DESCRIPTION
0023 -----------
0024 This function is designated for use in XATMI servers. Function requests the
0025 main thread loop to perform XATMI server process shutdown procedure. If server
0026 process currently serves a service call and in service code tpexit() is called,
0027 then after service returns, the XATMI server process main loop will terminate
0028 and will invoke the *tpsvrdone(3)* and *tpsvrthrdone(3)* accordingly. Normally
0029 tpexit() after the call returns the control to the caller.
0030 
0031 Once process is shutdown, the *ndrxd(8)* will restart the process (if restarts of 
0032 dead are configured).
0033 
0034 tpexit() can be called from other threads than main. In that case if server main
0035 thread is idling, the shutdown process will take a place immediately.
0036 
0037 Internally tpexit() sends the administrative shutdown message to it self.
0038 If admin queue at the moment is full (blocking), the tpexit() will perform direct
0039 exit(-1) of the process, without performing clean shutdown i.e. 
0040 *tpsvrdone(3)* and *tpsvrthrdone(3)* callbacks will not be invoked.
0041 
0042 When *tpreturn(3)* is called with *TPEXIT* flag, internally this function is invoked.
0043 
0044 If ATMI client process calls this function (i.e. linked with libatmiclt), exit(-1)
0045 is always called.
0046 
0047 
0048 ERRORS
0049 ------
0050 N/A
0051 
0052 EXAMPLE
0053 -------
0054 See *atmitest/test080_tpexit/atmisv80.c* for sample code.
0055 
0056 BUGS
0057 ----
0058 Report bugs to support@mavimax.com
0059 
0060 SEE ALSO
0061 --------
0062 *tpreturn(3)* *ndrxd(8)*
0063 
0064 COPYING
0065 -------
0066 (C) Mavimax, Ltd
0067