From a482c5de01a56e0822493d6c917ae0f418aeebfb Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Thu, 21 Jan 2016 14:36:45 +0100 Subject: [PATCH] core: start wtimer --- main.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/main.c b/main.c index da30f127c29..bc1e07ceed9 100644 --- a/main.c +++ b/main.c @@ -132,6 +132,7 @@ #include "sock_ut.h" #include "async_task.h" #include "dset.h" +#include "timer_proc.h" #ifdef DEBUG_DMALLOC #include @@ -1302,6 +1303,7 @@ int main_loop(void) cfg_register_child( 1 /* main = udp listener */ + 1 /* timer */ + + 1 /* wtimer */ #ifdef USE_SLOW_TIMER + 1 /* slow timer */ #endif @@ -1371,6 +1373,10 @@ int main_loop(void) }else{ } + if(sr_wtimer_start()<0) { + LM_CRIT("Cannot start wtimer\n"); + goto error; + } /* main process, receive loop */ process_no=0; /*main process number*/ pt[process_no].pid=getpid(); @@ -1402,6 +1408,7 @@ int main_loop(void) * will be added later.) */ cfg_register_child( 1 /* timer */ + + 1 /* wtimer */ #ifdef USE_SLOW_TIMER + 1 /* slow timer */ #endif @@ -1664,6 +1671,10 @@ int main_loop(void) if (arm_timer()<0) goto error; timer_main(); } + if(sr_wtimer_start()<0) { + LM_CRIT("Cannot start wtimer\n"); + goto error; + } /* init childs with rank==MAIN before starting tcp main (in case they want * to fork a tcp capable process, the corresponding tcp. comm. fds in @@ -1788,6 +1799,7 @@ static int calc_proc_no(void) #ifdef USE_SLOW_TIMER + 1 /* slow timer process */ #endif + + 1 /* wtimer process */ #ifdef USE_TCP +((!tcp_disable)?( 1/* tcp main */ + tcp_listeners ):0) #endif @@ -1911,6 +1923,7 @@ int main(int argc, char** argv) #ifdef USE_TCP init_tcp_options(); /* set the defaults before the config */ #endif + /* process command line (cfg. file path etc) */ optind = 1; /* reset getopt */ /* switches required before script processing */ @@ -2449,6 +2462,12 @@ int main(int argc, char** argv) LM_CRIT("could not initialize timer, exiting...\n"); goto error; } + /* init wtimer */ + if(sr_wtimer_init()<0) { + LM_CRIT("could not initialize wtimer, exiting...\n"); + goto error; + } + #ifdef USE_DNS_CACHE if (init_dns_cache()<0){ LM_CRIT("could not initialize the dns cache, exiting...\n");