From 31434bc0b901a80e401a276279dd1d71c74d3cae Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 27 Feb 2016 08:55:01 +1100 Subject: [PATCH] Create unix receivers during child setup --- src/ckpool.c | 3 ++- src/ckpool.h | 1 - src/connector.c | 2 -- src/generator.c | 1 - src/stratifier.c | 2 -- 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ckpool.c b/src/ckpool.c index c9aa494f..daa9b034 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -286,7 +286,7 @@ unix_msg_t *get_unix_msg(proc_instance_t *pi) return umsg; } -void create_unix_receiver(proc_instance_t *pi) +static void create_unix_receiver(proc_instance_t *pi) { pthread_t pth; @@ -1499,6 +1499,7 @@ static void prepare_child(ckpool_t *ckp, proc_instance_t *pi, void *process, cha pi->sockname = pi->processname; create_process_unixsock(pi); create_pthread(&pi->pth_process, process, pi); + create_unix_receiver(pi); } #ifdef USE_CKDB diff --git a/src/ckpool.h b/src/ckpool.h index 08de2914..6877bad5 100644 --- a/src/ckpool.h +++ b/src/ckpool.h @@ -318,7 +318,6 @@ ckmsgq_t *create_ckmsgqs(ckpool_t *ckp, const char *name, const void *func, cons void ckmsgq_add(ckmsgq_t *ckmsgq, void *data); bool ckmsgq_empty(ckmsgq_t *ckmsgq); unix_msg_t *get_unix_msg(proc_instance_t *pi); -void create_unix_receiver(proc_instance_t *pi); ckpool_t *global_ckp; diff --git a/src/connector.c b/src/connector.c index 4c25f064..467200f4 100644 --- a/src/connector.c +++ b/src/connector.c @@ -1577,8 +1577,6 @@ void *connector(void *arg) create_pthread(&cdata->pth_receiver, receiver, cdata); cdata->start_time = time(NULL); - create_unix_receiver(pi); - ret = connector_loop(pi, cdata); out: dealloc(ckp->cdata); diff --git a/src/generator.c b/src/generator.c index 418077d9..154b87cc 100644 --- a/src/generator.c +++ b/src/generator.c @@ -2915,7 +2915,6 @@ void *generator(void *arg) gdata = ckzalloc(sizeof(gdata_t)); ckp->gdata = gdata; gdata->ckp = ckp; - create_unix_receiver(pi); if (ckp->proxy) { char *buf = NULL; diff --git a/src/stratifier.c b/src/stratifier.c index e9afeb99..a319997d 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -7609,8 +7609,6 @@ void *stratifier(void *arg) mutex_init(&sdata->share_lock); mutex_init(&sdata->block_lock); - create_unix_receiver(pi); - LOGWARNING("%s stratifier ready", ckp->name); stratum_loop(ckp, pi);