aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2017-03-10 10:48:57 -0800
committerGravatar murgatroid99 <mlumish@google.com>2017-03-10 10:48:57 -0800
commit6bd07c656b8d0170eb499e9ee61cf9ca827d59c9 (patch)
tree0e0537a04ac2811e34656569a8469966dd95de2f /src/core/lib/iomgr
parentd8c83a5d527f1d070390b4e7464a9d1d14102d03 (diff)
Stop gRPC timers from keeping the UV loop open
Diffstat (limited to 'src/core/lib/iomgr')
-rw-r--r--src/core/lib/iomgr/timer_uv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/timer_uv.c b/src/core/lib/iomgr/timer_uv.c
index f28a14405d..8e8a07578c 100644
--- a/src/core/lib/iomgr/timer_uv.c
+++ b/src/core/lib/iomgr/timer_uv.c
@@ -78,6 +78,10 @@ void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer,
uv_timer->data = timer;
timer->uv_timer = uv_timer;
uv_timer_start(uv_timer, run_expired_timer, timeout, 0);
+ /* We assume that gRPC timers are only used alongside other active gRPC
+ objects, and that there will therefore always be something else keeping
+ the uv loop alive whenever there is a timer */
+ uv_unref((uv_handle_t *)uv_timer);
}
void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer) {