Since commit
d2494e048 ("BUG/MEDIUM: peers/config: properly set the
thread mask") there must not remain any single case of a receiver that
is bound nowhere, so there's no need anymore for thread_mask().
We're adding a test in fd_insert() to make sure this doesn't happen by
accident though, but the function was removed and its rare uses were
replaced with the original value of the bind_thread msak.
BUG_ON(fd < 0 || fd >= global.maxsock);
BUG_ON(fdtab[fd].owner != NULL);
BUG_ON(fdtab[fd].state != 0);
+ BUG_ON(thread_mask == 0);
fdtab[fd].owner = owner;
fdtab[fd].iocb = iocb;
#endif /* USE_THREAD */
-/* returns a mask if set, otherwise all_threads_mask */
-static inline unsigned long thread_mask(unsigned long mask)
-{
- return mask ? mask : all_threads_mask;
-}
-
#endif /* _HAPROXY_THREAD_H */
if (l->rx.flags & RX_F_LOCAL_ACCEPT)
goto local_accept;
- mask = thread_mask(l->rx.bind_thread) & all_threads_mask;
+ mask = l->rx.bind_thread & all_threads_mask;
if (atleast2(mask) && (global.tune.options & GTUNE_LISTENER_MQ) && !stopping) {
struct accept_queue_ring *ring;
unsigned int t, t0, t1, t2;
rx->flags |= RX_F_BOUND;
- fd_insert(rx->fd, rx->owner, rx->iocb, thread_mask(rx->bind_thread) & all_threads_mask);
+ fd_insert(rx->fd, rx->owner, rx->iocb, rx->bind_thread & all_threads_mask);
return err;
bind_return:
rx->fd = fd;
rx->flags |= RX_F_BOUND;
- fd_insert(fd, rx->owner, rx->iocb, thread_mask(rx->bind_thread) & all_threads_mask);
+ fd_insert(fd, rx->owner, rx->iocb, rx->bind_thread & all_threads_mask);
/* for now, all regularly bound TCP listeners are exportable */
if (!(rx->flags & RX_F_INHERITED))
rx->fd = fd;
rx->flags |= RX_F_BOUND;
- fd_insert(fd, rx->owner, rx->iocb, thread_mask(rx->bind_thread) & all_threads_mask);
+ fd_insert(fd, rx->owner, rx->iocb, rx->bind_thread & all_threads_mask);
/* for now, all regularly bound TCP listeners are exportable */
if (!(rx->flags & RX_F_INHERITED))