mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
CLEANUP: threads: use nbits to calculate the thread mask
It's pointless to do arithmetics by hand, we have a function for this.
This commit is contained in:
parent
da9e939f3c
commit
fc647360e0
@ -157,9 +157,7 @@ int parse_nbthread(const char *arg, char **err)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we proceed like this to be sure never to overflow the left shift */
|
all_threads_mask = nbits(nbthread);
|
||||||
all_threads_mask = 1UL << (nbthread - 1);
|
|
||||||
all_threads_mask |= all_threads_mask - 1;
|
|
||||||
#endif
|
#endif
|
||||||
return nbthread;
|
return nbthread;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user