From: William Lallemand Date: Tue, 5 Jul 2022 07:04:03 +0000 (+0200) Subject: CLEANUP: mworker: rename mworker_pipe to mworker_sockpair X-Git-Tag: v2.7-dev2~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ee490f613a1f31f00069233b1dfcdfed0e71eaf;p=thirdparty%2Fhaproxy.git CLEANUP: mworker: rename mworker_pipe to mworker_sockpair The function mworker_pipe_register_per_thread() is called this way because the master first used pipes instead of socketpairs. Rename mworker_pipe_register_per_thread() to mworker_sockpair_register_per_thread() in order to be more consistent. Also update a comment inside the function. --- diff --git a/src/mworker.c b/src/mworker.c index 364d0a956c..4da3c3e49c 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -413,7 +413,7 @@ void mworker_accept_wrapper(int fd) * worker. It's only handled by worker thread #0. Other threads and master do * nothing here. It always returns 1 (success). */ -static int mworker_pipe_register_per_thread() +static int mworker_sockpair_register_per_thread() { if (!(global.mode & MODE_MWORKER) || master) return 1; @@ -422,15 +422,13 @@ static int mworker_pipe_register_per_thread() return 1; fd_set_nonblock(proc_self->ipc_fd[1]); - /* In multi-tread, we need only one thread to process - * events on the pipe with master - */ + /* register the wrapper to handle read 0 when the master exits */ fdtab[proc_self->ipc_fd[1]].iocb = mworker_accept_wrapper; fd_want_recv(proc_self->ipc_fd[1]); return 1; } -REGISTER_PER_THREAD_INIT(mworker_pipe_register_per_thread); +REGISTER_PER_THREAD_INIT(mworker_sockpair_register_per_thread); /* ----- proxies ----- */ /*