mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
BUG/MINOR: threads: Fixes the number of possible cpus report for Mac.
There is no low level api to achieve same as Linux/FreeBSD, we rely on CPUs available. Without this, the number of threads is just 1 for Mac while having 8 cores in my M1. Backporting to 2.1 should be enough if that's possible. Signed-off-by: David CARLIER <devnexen@gmail.com>
This commit is contained in:
parent
e3bdc81f8a
commit
6a9060189d
@ -182,6 +182,8 @@ static int thread_cpus_enabled()
|
||||
if (cpuset_getaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID, -1,
|
||||
sizeof(cpuset), &cpuset) == 0)
|
||||
ret = CPU_COUNT(&cpuset);
|
||||
#elif defined(__APPLE__)
|
||||
ret = (int)sysconf(_SC_NPROCESSORS_ONLN);
|
||||
#endif
|
||||
#endif
|
||||
ret = MAX(ret, 1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user