diff options
author | Muxi Yan <mxyan@google.com> | 2017-01-10 03:13:30 +0000 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2017-01-10 03:13:30 +0000 |
commit | 217548d0f9f8b8ea671290bd990d076cc3741139 (patch) | |
tree | 0f96657c954f6ce10be2568b02e5dae7fe0bcb51 /src/core/lib/surface/alarm.c | |
parent | 871626ff160b6431c3b20ba906d80f4aa7edc0c1 (diff) | |
parent | a3960b98d6a1b85a1e3b89cd7797a509505fa207 (diff) |
Merge remote-tracking branch 'upstream/master' into change_cronet_interface
Diffstat (limited to 'src/core/lib/surface/alarm.c')
-rw-r--r-- | src/core/lib/surface/alarm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/lib/surface/alarm.c b/src/core/lib/surface/alarm.c index aa9d60ee6a..e71c0ebfc5 100644 --- a/src/core/lib/surface/alarm.c +++ b/src/core/lib/surface/alarm.c @@ -38,6 +38,7 @@ struct grpc_alarm { grpc_timer alarm; + grpc_closure on_alarm; grpc_cq_completion completion; /** completion queue where events about this alarm will be posted */ grpc_completion_queue *cq; @@ -64,9 +65,11 @@ grpc_alarm *grpc_alarm_create(grpc_completion_queue *cq, gpr_timespec deadline, alarm->tag = tag; grpc_cq_begin_op(cq, tag); + grpc_closure_init(&alarm->on_alarm, alarm_cb, alarm, + grpc_schedule_on_exec_ctx); grpc_timer_init(&exec_ctx, &alarm->alarm, gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC), - alarm_cb, alarm, gpr_now(GPR_CLOCK_MONOTONIC)); + &alarm->on_alarm, gpr_now(GPR_CLOCK_MONOTONIC)); grpc_exec_ctx_finish(&exec_ctx); return alarm; } |