Back to home page

Enduro/X

 
 

    


0001 /**
0002  * @brief Queue server main entry. Needed for xa early driver setup.
0003  *
0004  * @file tmqsrvmain.c
0005  */
0006 /* -----------------------------------------------------------------------------
0007  * Enduro/X Middleware Platform for Distributed Transaction Processing
0008  * Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
0009  * Copyright (C) 2017-2018, Mavimax, Ltd. All Rights Reserved.
0010  * This software is released under one of the following licenses:
0011  * AGPL or Mavimax's license for commercial use.
0012  * -----------------------------------------------------------------------------
0013  * AGPL license:
0014  * 
0015  * This program is free software; you can redistribute it and/or modify it under
0016  * the terms of the GNU Affero General Public License, version 3 as published
0017  * by the Free Software Foundation;
0018  *
0019  * This program is distributed in the hope that it will be useful, but WITHOUT ANY
0020  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0021  * PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
0022  * for more details.
0023  *
0024  * You should have received a copy of the GNU Affero General Public License along 
0025  * with this program; if not, write to the Free Software Foundation, Inc., 
0026  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0027  *
0028  * -----------------------------------------------------------------------------
0029  * A commercial use license is available from Mavimax, Ltd
0030  * contact@mavimax.com
0031  * -----------------------------------------------------------------------------
0032  */
0033 
0034 /*---------------------------Includes-----------------------------------*/
0035 #include <stdio.h>
0036 #include <stdlib.h>
0037 #include <ndebug.h>
0038 #include <atmi.h>
0039 #include <ndrstandard.h>
0040 #include <ubf.h>
0041 #include <string.h>
0042 #include <unistd.h>
0043 #include <xa.h>
0044 #include "tmqueue.h"
0045 #include "tmqd.h"
0046 #include "../libatmisrv/srv_int.h"
0047 /*---------------------------Externs------------------------------------*/
0048 /*---------------------------Macros-------------------------------------*/
0049 /*---------------------------Enums--------------------------------------*/
0050 /*---------------------------Typedefs-----------------------------------*/
0051 /*---------------------------Globals------------------------------------*/
0052 expublic void (*G_tmq_chkdisk_th)(void *ptr, int *p_finish_off);
0053 /*---------------------------Statics------------------------------------*/
0054 /* Auto generated system advertise table */
0055 expublic struct tmdsptchtbl_t ndrx_G_tmdsptchtbl[] = {
0056     { NULL, NULL, NULL, 0, 0 }
0057 };
0058 /*---------------------------Prototypes---------------------------------*/
0059 
0060 /**
0061  * Main entry for tmsrv
0062  */
0063 int main( int argc, char** argv )
0064 {
0065     _tmbuilt_with_thread_option=0;
0066         
0067     /* mark the qdisk that we are tmqueue
0068      * for direct log calls
0069      * So what let to do for others is just to start the transaction
0070      * join for other is just ignored.
0071      */
0072     tmq_set_tmqueue(EXTRUE, tmq_setup_cmdheader_dum, tmq_dum_add, tmq_unlock_msg,
0073         &G_tmq_chkdisk_th, tmq_msgid_exists, tpexit);
0074     /* do late join, to avoid deadlock betweem tmsrv registration and same tmsrv
0075      * tran compleation via notifications channel
0076      */
0077     ndrx_sv_set_autojoin(EXFALSE);
0078     
0079     struct tmsvrargs_t tmsvrargs =
0080     {
0081         &tmnull_switch,
0082         &ndrx_G_tmdsptchtbl[0],
0083         0,
0084         tpsvrinit,
0085         tpsvrdone,
0086         NULL,
0087         NULL,
0088         NULL,
0089         NULL,
0090         NULL,
0091         NULL,
0092         NULL
0093     };
0094     
0095     return( _tmstartserver( argc, argv, &tmsvrargs ));
0096     
0097 }
0098 
0099 /* vim: set ts=4 sw=4 et smartindent: */