/[dotgnu-pnet]/pnet/libgc/pthread_support.c
ViewVC logotype

Diff of /pnet/libgc/pthread_support.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by ktreichel, Sat Jul 23 12:52:58 2005 UTC revision 1.3 by ktreichel, Sat Sep 17 16:54:39 2005 UTC
# Line 116  Line 116 
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    
# Line 877  void GC_thr_init() Line 877  void GC_thr_init()
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);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26