diff options
author | Craig Tiller <ctiller@google.com> | 2015-05-04 15:46:54 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-05-04 15:46:54 -0700 |
commit | 80abd54fc1081ea3585b45d63bbd9a5f7612a843 (patch) | |
tree | a25227a26e35ccc14549efe43c631d437559383a /src/core/support | |
parent | 12c4d4e4a389b15dc12b8b87d4f1fe5964014a85 (diff) | |
parent | 6dc550287163b7a1ac31808418a8102d794cc238 (diff) |
Merge github.com:grpc/grpc into swappy
Diffstat (limited to 'src/core/support')
-rw-r--r-- | src/core/support/cpu_windows.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core/support/cpu_windows.c b/src/core/support/cpu_windows.c index cb454ccd3b..f56bab3f8b 100644 --- a/src/core/support/cpu_windows.c +++ b/src/core/support/cpu_windows.c @@ -34,19 +34,17 @@ #include <grpc/support/port_platform.h> #ifdef GPR_WIN32 - +#include <windows.h> #include <grpc/support/log.h> unsigned gpr_cpu_num_cores(void) { - /* TODO(jtattermusch): implement */ - gpr_log(GPR_ERROR, "Cannot determine number of CPUs: assuming 1"); - return 1; + SYSTEM_INFO si; + GetSystemInfo(&si); + return si.dwNumberOfProcessors; } unsigned gpr_cpu_current_cpu(void) { - /* TODO(jtattermusch): implement */ - gpr_log(GPR_ERROR, "Cannot determine current CPU"); - return 0; + return GetCurrentProcessorNumber(); } #endif /* GPR_WIN32 */ |