Boost logo

Boost-Commit :

From: anthony_at_[hidden]
Date: 2008-07-21 06:39:51


Author: anthonyw
Date: 2008-07-21 06:39:50 EDT (Mon, 21 Jul 2008)
New Revision: 47654
URL: http://svn.boost.org/trac/boost/changeset/47654

Log:
Use sysconf(_SC_NPROCESSORS_ONLN) where it is available, as a fallback
Text files modified:
   trunk/libs/thread/src/pthread/thread.cpp | 4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)

Modified: trunk/libs/thread/src/pthread/thread.cpp
==============================================================================
--- trunk/libs/thread/src/pthread/thread.cpp (original)
+++ trunk/libs/thread/src/pthread/thread.cpp 2008-07-21 06:39:50 EDT (Mon, 21 Jul 2008)
@@ -18,7 +18,7 @@
 #elif defined(__APPLE__) || defined(__FreeBSD__)
 #include <sys/types.h>
 #include <sys/sysctl.h>
-#elif defined(__sun) || defined(__CYGWIN__) || defined(_AIX)
+#elif defined BOOST_HAS_UNISTD_H
 #include <unistd.h>
 #endif
 
@@ -394,7 +394,7 @@
         int count;
         size_t size=sizeof(count);
         return sysctlbyname("hw.ncpu",&count,&size,NULL,0)?0:count;
-#elif defined(__sun) || defined(__CYGWIN__) || defined(_AIX)
+#elif defined(BOOST_HAS_UNISTD_H) && defined(_SC_NPROCESSORS_ONLN)
         int const count=sysconf(_SC_NPROCESSORS_ONLN);
         return (count>0)?count:0;
 #else


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk