mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
MINOR: threads: make use of thread_mask() to simplify some thread calculations
By doing so it's visible that some fd_insert() calls were relying on MAX_THREADS while all_threads_mask should have been more suitable.
This commit is contained in:
parent
6daac19b3f
commit
3d95717b58
@ -2287,8 +2287,8 @@ int check_config_validity()
|
||||
|
||||
/* detect and address thread affinity inconsistencies */
|
||||
nbproc = my_ffsl(proc_mask(bind_conf->bind_proc)) - 1;
|
||||
mask = bind_conf->bind_thread[nbproc];
|
||||
if (mask && !(mask & all_threads_mask)) {
|
||||
mask = thread_mask(bind_conf->bind_thread[nbproc]);
|
||||
if (!(mask & all_threads_mask)) {
|
||||
unsigned long new_mask = 0;
|
||||
|
||||
while (mask) {
|
||||
|
@ -153,8 +153,7 @@ static int sockpair_bind_listener(struct listener *listener, char *errmsg, int e
|
||||
listener->state = LI_LISTEN;
|
||||
|
||||
fd_insert(fd, listener, listener->proto->accept,
|
||||
listener->bind_conf->bind_thread[relative_pid-1] ?
|
||||
listener->bind_conf->bind_thread[relative_pid-1] : MAX_THREADS_MASK);
|
||||
thread_mask(listener->bind_conf->bind_thread[relative_pid-1]));
|
||||
|
||||
return err;
|
||||
|
||||
|
@ -1076,8 +1076,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
|
||||
listener->state = LI_LISTEN;
|
||||
|
||||
fd_insert(fd, listener, listener->proto->accept,
|
||||
listener->bind_conf->bind_thread[relative_pid-1] ?
|
||||
listener->bind_conf->bind_thread[relative_pid-1] : MAX_THREADS_MASK);
|
||||
thread_mask(listener->bind_conf->bind_thread[relative_pid-1]));
|
||||
|
||||
tcp_return:
|
||||
if (msg && errlen) {
|
||||
|
@ -340,8 +340,7 @@ static int uxst_bind_listener(struct listener *listener, char *errmsg, int errle
|
||||
listener->state = LI_LISTEN;
|
||||
|
||||
fd_insert(fd, listener, listener->proto->accept,
|
||||
listener->bind_conf->bind_thread[relative_pid-1] ?
|
||||
listener->bind_conf->bind_thread[relative_pid-1] : MAX_THREADS_MASK);
|
||||
thread_mask(listener->bind_conf->bind_thread[relative_pid-1]));
|
||||
|
||||
return err;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user