Module: kamailio
Branch: master
Commit: e7510dc082d84a87558208f47d14d27c86885809
URL:
https://github.com/kamailio/kamailio/commit/e7510dc082d84a87558208f47d14d27…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-06-11T10:06:19+02:00
async: initialize module timer processes based on workers parameter
---
Modified: modules/async/async_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e7510dc082d84a87558208f47d14d27…
Patch:
https://github.com/kamailio/kamailio/commit/e7510dc082d84a87558208f47d14d27…
---
diff --git a/modules/async/async_mod.c b/modules/async/async_mod.c
index 8cd6fac..2240e70 100644
--- a/modules/async/async_mod.c
+++ b/modules/async/async_mod.c
@@ -116,16 +116,20 @@ static int mod_init(void)
*/
static int child_init(int rank)
{
+ int i;
+
if (rank!=PROC_MAIN)
return 0;
if(async_workers<=0)
return 0;
- if(fork_dummy_timer(PROC_TIMER, "ASYNC MOD TIMER", 1 /*socks flag*/,
+ for(i=0; i<async_workers; i++) {
+ if(fork_dummy_timer(PROC_TIMER, "ASYNC MOD TIMER", 1 /*socks flag*/,
async_timer_exec, NULL, 1 /*sec*/)<0) {
- LM_ERR("failed to register timer routine as process\n");
- return -1; /* error */
+ LM_ERR("failed to register timer routine as process (%d)\n", i);
+ return -1; /* error */
+ }
}
return 0;