]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: mworker: set the iocb of the socketpair without using fd_insert()
authorWilliam Lallemand <wlallemand@haproxy.org>
Mon, 4 Jul 2022 22:55:09 +0000 (00:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 Jul 2022 03:18:51 +0000 (05:18 +0200)
The worker was previously changing the iocb of the socketpair in the
worker by mworker_accept_wrapper(). However, it was done using
fd_insert() instead of changing directly the callback in the
fdtab[].iocb pointer.

This patch cleans up this by part by removing fd_insert().

It also stops setting tid_bit on the thread mask, the socketpair will be
handled by any thread from now.

src/mworker.c

index 6a4fce48c215856339acfcee77b1363aedc44e12..364d0a956c888796e3fd1c942334c3a7f266072c 100644 (file)
@@ -425,7 +425,7 @@ static int mworker_pipe_register_per_thread()
        /* In multi-tread, we need only one thread to process
         * events on the pipe with master
         */
-       fd_insert(proc_self->ipc_fd[1], fdtab[proc_self->ipc_fd[1]].owner, mworker_accept_wrapper, tid_bit);
+       fdtab[proc_self->ipc_fd[1]].iocb = mworker_accept_wrapper;
        fd_want_recv(proc_self->ipc_fd[1]);
        return 1;
 }