aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-01 10:06:53 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-01 10:06:53 -0700
commit76eabbd3af3148f4a820c04923e12b699d9d9df7 (patch)
tree53ab74690d0cd207f56e2e8fca28b48063c927cd /src/core
parentff4ee964d4741c5239a458c366e762e3b3cb3ccf (diff)
parent18d43bfcfeeba96109063511ccd59c58283721ee (diff)
Merge github.com:grpc/grpc into delete-the-old-api
Conflicts: vsprojects/Grpc.mak
Diffstat (limited to 'src/core')
-rw-r--r--src/core/support/cpu_windows.c12
-rw-r--r--src/core/surface/call.c4
2 files changed, 9 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 */
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 5513a63332..136921656f 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -711,6 +711,10 @@ static void call_on_done_recv(void *pc, int success) {
if (call->recv_state == GRPC_STREAM_CLOSED) {
GPR_ASSERT(call->read_state <= READ_STATE_STREAM_CLOSED);
call->read_state = READ_STATE_STREAM_CLOSED;
+ if (call->have_alarm) {
+ grpc_alarm_cancel(&call->alarm);
+ call->have_alarm = 0;
+ }
}
finish_read_ops(call);
} else {