Git fork

Merge branch 'bs/online-cpus-bsd'

Update online_cpus() functrion on BSD variants.

* bs/online-cpus-bsd:
thread-utils.c: detect online CPU count on OpenBSD / NetBSD

+4 -4
+4 -4
thread-utils.c
··· 46 46 mib[0] = CTL_HW; 47 47 # ifdef HW_AVAILCPU 48 48 mib[1] = HW_AVAILCPU; 49 - len = sizeof(cpucount); 50 - if (!sysctl(mib, 2, &cpucount, &len, NULL, 0)) 51 - return cpucount; 52 - # endif /* HW_AVAILCPU */ 49 + # elif defined(HW_NCPUONLINE) 50 + mib[1] = HW_NCPUONLINE; 51 + # else 53 52 mib[1] = HW_NCPU; 53 + # endif /* HW_AVAILCPU */ 54 54 len = sizeof(cpucount); 55 55 if (!sysctl(mib, 2, &cpucount, &len, NULL, 0)) 56 56 return cpucount;