]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: mworker: rename mworker_pipe to mworker_sockpair
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 5 Jul 2022 07:04:03 +0000 (09:04 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 5 Jul 2022 07:06:04 +0000 (09:06 +0200)
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

index 364d0a956c888796e3fd1c942334c3a7f266072c..4da3c3e49cac0f4141ea9c0cfb029f41f203902a 100644 (file)
@@ -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 ----- */
 /*