]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads/polling: pollers now handle FDs depending on the process mask
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 2 Jun 2017 12:36:39 +0000 (14:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 12:58:30 +0000 (13:58 +0100)
src/ev_epoll.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c

index 0b815b45b55e253147ce578bd3711638ca52b58c..642b4d61f6f0bae02e7ca56cc9c177f8726d093b 100644 (file)
@@ -136,7 +136,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                unsigned int e = epoll_events[count].events;
                fd = epoll_events[count].data.fd;
 
-               if (!fdtab[fd].owner)
+               if (!fdtab[fd].owner || !(fdtab[fd].process_mask & tid_bit))
                        continue;
 
                /* it looks complicated but gcc can optimize it away when constants
index 326d616078336caf06422597620a06d2660640bd..8f20db26a53880df2281fde7c44d629e9460617f 100644 (file)
@@ -122,7 +122,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                unsigned int n = 0;
                fd = kev[count].ident;
 
-               if (!fdtab[fd].owner)
+               if (!fdtab[fd].owner || !(fdtab[fd].process_mask & tid_bit))
                        continue;
 
                if (kev[count].filter ==  EVFILT_READ) {
index e16968bcfe5d77283cf419c1642944bf8d695e9b..455c4e1e916cef43fb3c58ac8bb30f30d3181e6f 100644 (file)
@@ -111,6 +111,10 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                        continue;
 
                for (count = 0, fd = fds * 8*sizeof(**fd_evts); count < 8*sizeof(**fd_evts) && fd < maxfd; count++, fd++) {
+
+                       if (!fdtab[fd].owner || !(fdtab[fd].process_mask & tid_bit))
+                               continue;
+
                        sr = (rn >> count) & 1;
                        sw = (wn >> count) & 1;
                        if ((sr|sw)) {
index 97d42861fe9c5ccb934fe1b0f33f596b59dfe0bd..49e980f00807ac79e3c82a729614430ab0f06926 100644 (file)
@@ -141,7 +141,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                        /* if we specify read first, the accepts and zero reads will be
                         * seen first. Moreover, system buffers will be flushed faster.
                         */
-                       if (!fdtab[fd].owner)
+                       if (!fdtab[fd].owner || !(fdtab[fd].process_mask & tid_bit))
                                continue;
 
                        if (FD_ISSET(fd, tmp_evts[DIR_RD]))