]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads/fd: Add a mask of threads allowed to process on each fd in fdtab array
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 30 May 2017 09:05:09 +0000 (11:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 12:58:30 +0000 (13:58 +0100)
include/proto/fd.h
include/types/fd.h
src/fd.c

index e47d8fd5f1b4bd3003f7f49e03035c40b72af5e1..465d6601a8fe11ca0379469b8727a98167ce34ab 100644 (file)
@@ -404,6 +404,7 @@ static inline void fd_insert(int fd)
        fdtab[fd].linger_risk = 0;
        fdtab[fd].cloned = 0;
        fdtab[fd].cache = 0;
+       fdtab[fd].process_mask = 0; // unused for now
        SPIN_UNLOCK(FD_LOCK, &fdtab[fd].lock);
 
        SPIN_LOCK(FDTAB_LOCK, &fdtab_lock);
index 7042dab11adc81b2891d9a647a9a2fd28d3a0b3a..e196aec9844ee00d90e909cf0d40fc9fa543c67c 100644 (file)
@@ -94,6 +94,7 @@ enum fd_states {
 struct fdtab {
        void (*iocb)(int fd);                /* I/O handler */
        void *owner;                         /* the connection or listener associated with this fd, NULL if closed */
+       unsigned long process_mask;          /* mask of thread IDs authorized to process the task */
 #ifdef USE_THREAD
        HA_SPINLOCK_T lock;
 #endif
index 6c53a3b283b181c7a8ac7ef569c811fc6dc5de7c..262127851c2ba8f4c819d221b555c5256aa07fae 100644 (file)
--- a/src/fd.c
+++ b/src/fd.c
@@ -202,6 +202,7 @@ static void fd_dodelete(int fd, int do_close)
        fdtab[fd].owner = NULL;
        fdtab[fd].updated = 0;
        fdtab[fd].new = 0;
+       fdtab[fd].process_mask = 0;
        if (do_close)
                close(fd);
        SPIN_UNLOCK(FD_LOCK, &fdtab[fd].lock);