From a7c5d43085d93d7d02d5181d696eaeaf9905633f Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 30 May 2017 11:05:09 +0200 Subject: [PATCH] MINOR: threads/fd: Add a mask of threads allowed to process on each fd in fdtab array --- include/proto/fd.h | 1 + include/types/fd.h | 1 + src/fd.c | 1 + 3 files changed, 3 insertions(+) diff --git a/include/proto/fd.h b/include/proto/fd.h index e47d8fd5f..465d6601a 100644 --- a/include/proto/fd.h +++ b/include/proto/fd.h @@ -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); diff --git a/include/types/fd.h b/include/types/fd.h index 7042dab11..e196aec98 100644 --- a/include/types/fd.h +++ b/include/types/fd.h @@ -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 diff --git a/src/fd.c b/src/fd.c index 6c53a3b28..262127851 100644 --- 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);