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:
Willy Tarreau 2019-02-02 17:05:03 +01:00
parent da9e939f3c
commit fc647360e0

View File

@ -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;
} }