116 |
# include <semaphore.h> |
# include <semaphore.h> |
117 |
#endif /* !GC_DARWIN_THREADS */ |
#endif /* !GC_DARWIN_THREADS */ |
118 |
|
|
119 |
#if defined(GC_DARWIN_THREADS) |
#if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) |
120 |
# include <sys/sysctl.h> |
# include <sys/sysctl.h> |
121 |
#endif /* GC_DARWIN_THREADS */ |
#endif /* GC_DARWIN_THREADS */ |
122 |
|
|
877 |
GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN); |
GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN); |
878 |
if (GC_nprocs <= 0) GC_nprocs = 1; |
if (GC_nprocs <= 0) GC_nprocs = 1; |
879 |
# endif |
# endif |
880 |
# if defined(GC_FREEBSD_THREADS) || defined(GC_IRIX_THREADS) |
# if defined(GC_IRIX_THREADS) |
881 |
/* FIXME: For Irix, that's a ridiculous assumption. */ |
GC_nprocs = sysconf(_SC_NPROC_ONLN); |
882 |
GC_nprocs = 1; |
if (GC_nprocs <= 0) GC_nprocs = 1; |
883 |
# endif |
# endif |
884 |
# if defined(GC_DARWIN_THREADS) |
# if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) |
885 |
int ncpus = 1; |
int ncpus = 1; |
886 |
size_t len = sizeof(ncpus); |
size_t len = sizeof(ncpus); |
887 |
sysctl((int[2]) {CTL_HW, HW_NCPU}, 2, &ncpus, &len, NULL, 0); |
sysctl((int[2]) {CTL_HW, HW_NCPU}, 2, &ncpus, &len, NULL, 0); |