MINOR: threads/fd: Add a mask of threads allowed to process on each fd in fdtab array

This commit is contained in:
Christopher Faulet 2017-05-30 11:05:09 +02:00 committed by Willy Tarreau
parent d4604adeaa
commit a7c5d43085
3 changed files with 3 additions and 0 deletions

View File

@ -404,6 +404,7 @@ static inline void fd_insert(int fd)
fdtab[fd].linger_risk = 0; fdtab[fd].linger_risk = 0;
fdtab[fd].cloned = 0; fdtab[fd].cloned = 0;
fdtab[fd].cache = 0; fdtab[fd].cache = 0;
fdtab[fd].process_mask = 0; // unused for now
SPIN_UNLOCK(FD_LOCK, &fdtab[fd].lock); SPIN_UNLOCK(FD_LOCK, &fdtab[fd].lock);
SPIN_LOCK(FDTAB_LOCK, &fdtab_lock); SPIN_LOCK(FDTAB_LOCK, &fdtab_lock);

View File

@ -94,6 +94,7 @@ enum fd_states {
struct fdtab { struct fdtab {
void (*iocb)(int fd); /* I/O handler */ void (*iocb)(int fd); /* I/O handler */
void *owner; /* the connection or listener associated with this fd, NULL if closed */ 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 #ifdef USE_THREAD
HA_SPINLOCK_T lock; HA_SPINLOCK_T lock;
#endif #endif

View File

@ -202,6 +202,7 @@ static void fd_dodelete(int fd, int do_close)
fdtab[fd].owner = NULL; fdtab[fd].owner = NULL;
fdtab[fd].updated = 0; fdtab[fd].updated = 0;
fdtab[fd].new = 0; fdtab[fd].new = 0;
fdtab[fd].process_mask = 0;
if (do_close) if (do_close)
close(fd); close(fd);
SPIN_UNLOCK(FD_LOCK, &fdtab[fd].lock); SPIN_UNLOCK(FD_LOCK, &fdtab[fd].lock);