diff options
Diffstat (limited to 'boost/interprocess/detail/os_thread_functions.hpp')
-rw-r--r-- | boost/interprocess/detail/os_thread_functions.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/boost/interprocess/detail/os_thread_functions.hpp b/boost/interprocess/detail/os_thread_functions.hpp index 8a0a47cc27..1c48ecf58b 100644 --- a/boost/interprocess/detail/os_thread_functions.hpp +++ b/boost/interprocess/detail/os_thread_functions.hpp @@ -52,6 +52,9 @@ # include <sys/param.h> # include <sys/sysctl.h> # endif +#if defined(__VXWORKS__) +#include <vxCpuLib.h> +#endif //According to the article "C/C++ tip: How to measure elapsed real time for benchmarking" //Check MacOs first as macOS 10.12 SDK defines both CLOCK_MONOTONIC and //CLOCK_MONOTONIC_RAW and no clock_gettime. @@ -480,6 +483,18 @@ inline unsigned int get_num_cores() else{ return static_cast<unsigned int>(num_cores); } + #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 #endif } |