summaryrefslogtreecommitdiff
path: root/ACE/ace/OS_NS_unistd.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2008-03-21 16:13:49 +0000
committerSteve Huston <shuston@riverace.com>2008-03-21 16:13:49 +0000
commit45e0d4ab9d9bed866a8a13e24a8a1bd594bd46bb (patch)
tree9af87d97432f2acb15528acedc7c057c2f3869da /ACE/ace/OS_NS_unistd.cpp
parente18b0e5b5eb1d54877cf3031fae206e6869e1cec (diff)
downloadATCD-45e0d4ab9d9bed866a8a13e24a8a1bd594bd46bb.tar.gz
ChangeLogTag:Fri Mar 21 16:12:53 UTC 2008 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/ace/OS_NS_unistd.cpp')
-rw-r--r--ACE/ace/OS_NS_unistd.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/ACE/ace/OS_NS_unistd.cpp b/ACE/ace/OS_NS_unistd.cpp
index 112f49e6253..e0736f6abfc 100644
--- a/ACE/ace/OS_NS_unistd.cpp
+++ b/ACE/ace/OS_NS_unistd.cpp
@@ -385,7 +385,15 @@ ACE_OS::num_processors_online (void)
#elif defined (ACE_WIN32)
SYSTEM_INFO sys_info;
::GetSystemInfo (&sys_info);
- return sys_info.dwNumberOfProcessors;
+ long active_processors = 0;
+ DWORD_PTR mask = sys_info.dwActiveProcessorMask;
+ while (mask != 0)
+ {
+ if (mask & 1)
+ ++active_processors;
+ mask >>= 1;
+ }
+ return active_processors;
#elif defined (_SC_NPROCESSORS_ONLN)
return ::sysconf (_SC_NPROCESSORS_ONLN);
#elif defined (ACE_HAS_SYSCTL)