Update Windows to use the monotonic clock for alarms also

pull/2529/head
Craig Tiller 9 years ago
parent 4f101bd6b9
commit 4a6f9e08e9
  1. 2
      src/core/iomgr/pollset_windows.c
  2. 2
      src/core/iomgr/tcp_client_windows.c

@ -70,7 +70,7 @@ void grpc_pollset_destroy(grpc_pollset *pollset) {
int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) { int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) {
gpr_timespec now; gpr_timespec now;
now = gpr_now(GPR_CLOCK_REALTIME); now = gpr_now(GPR_CLOCK_MONOTONIC);
if (gpr_time_cmp(now, deadline) > 0) { if (gpr_time_cmp(now, deadline) > 0) {
return 0 /* GPR_FALSE */; return 0 /* GPR_FALSE */;
} }

@ -216,7 +216,7 @@ void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *tcp),
ac->aborted = 0; ac->aborted = 0;
grpc_alarm_init(&ac->alarm, deadline, on_alarm, ac, grpc_alarm_init(&ac->alarm, deadline, on_alarm, ac,
gpr_now(GPR_CLOCK_REALTIME)); gpr_now(GPR_CLOCK_MONOTONIC));
socket->write_info.outstanding = 1; socket->write_info.outstanding = 1;
grpc_socket_notify_on_write(socket, on_connect, ac); grpc_socket_notify_on_write(socket, on_connect, ac);
return; return;

Loading…
Cancel
Save