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 e47d8fd..465d660 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 7042dab..e196aec 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 6c53a3b..2621278 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);