diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index 5e51f8ea..3cac2385 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -27,6 +27,10 @@ #include #endif +#if defined(__VXWORKS__) +#include +#endif + #include #include #include @@ -556,6 +560,18 @@ namespace boost #elif defined(BOOST_HAS_UNISTD_H) && defined(_SC_NPROCESSORS_ONLN) int const count=sysconf(_SC_NPROCESSORS_ONLN); return (count>0)?count:0; +#elif defined(__VXWORKS__) + cpuset_t set = ::vxCpuEnabledGet(); + #ifdef __DCC__ + int i; + for( i = 0; set; ++i) + { + set &= set -1; + } + return(i); + #else + return (__builtin_popcount(set) ); + #endif #elif defined(__GLIBC__) return get_nprocs(); #else