From 2ee490f613a1f31f00069233b1dfcdfed0e71eaf Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 5 Jul 2022 09:04:03 +0200 Subject: [PATCH] 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. --- src/mworker.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mworker.c b/src/mworker.c index 364d0a956..4da3c3e49 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 ----- */ /*