Back to home page

Enduro/X

 
 

    


0001 TPSVRTHRDONE(3)
0002 ===============
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tpsvrthrdone - Template and default version for server dispatch thread de-init function
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <atmi.h>
0014 
0015 void tpsvrthrdone (void);
0016 
0017 For XATMI server link with '-latmisrvinteg -latmi -lubf -lnstd -lpthread -lrt -lm'
0018 
0019 DESCRIPTION
0020 -----------
0021 This function is called upon XATMI server process shutting down. Function is invoked
0022 for XATMI servers which are configured to work in multi-threaded mode.
0023 
0024 Normally at *tpsvrthrdone()* is used for threads to perform the de-initialization.
0025 
0026 The default version of this function is provided by Enduro/X which is built in
0027 in the the *-latmisrvinteg* library. Default version of the function invokes
0028 *tx_close()*.
0029 
0030 The *tpsvrthrdone()* is activated only
0031 
0032 . if XATMI server is built by *builserver(8)* having flag *-t* set.
0033 
0034 . Or XATMI server process is started by *_tmstartserver(3)* with extern variable 
0035 *_tmbuilt_with_thread_option* is set to *1*. And function name is specified in 
0036 *tmsvrargs_t* structure for the *p_tpsvrthrdone* field.
0037 
0038 In case if program is single threaded and default *tpsrvdone(3)* is used. Where
0039 default *tpsrvinit()* will invoke the *tpsvrthrinit()*.
0040 
0041 To start program as multi-threaded *ndrxconfig.xml(5)* in server section 
0042 *<mindispatchthreads>* and *<maxdispatchthreads>* must be greater than 1.
0043 
0044 This only applies to XATMI servers.
0045 
0046 In case if using C++ compiler, function must be defined without name mangling,
0047 thus extern "C" prefix shall be used.
0048 
0049 RETURN VALUE
0050 ------------
0051 If application failed to initialize, the user shall return non 0 value. 
0052 If succeed, then 0 must be returned.
0053 
0054 ERRORS
0055 ------
0056 Not available.
0057 
0058 EXAMPLE
0059 -------
0060 See *atmitest/test075_dispthread/atmisv75.c* for sample code.
0061 
0062 BUGS
0063 ----
0064 Report bugs to support@mavimax.com
0065 
0066 SEE ALSO
0067 --------
0068 *tpsvrdone(3)* *tpsvrinit(3)* *tpsvrthrinit(3)* 
0069 *_tmstartserver(3)* *ndrxconfig.xml(5)* *buildserver(8)*
0070 
0071 COPYING
0072 -------
0073 (C) Mavimax, Ltd
0074