MINOR: threads/fd: Add a mask of threads allowed to process on each fd in fdtab array
This commit is contained in:
parent
d4604adeaa
commit
a7c5d43085
|
@ -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);
|
||||||
|
|
|
@ -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
|
||||||
|
|
1
src/fd.c
1
src/fd.c
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue