aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-05-31 18:27:56 +0000
committerGravatar Craig Tiller <ctiller@google.com>2017-05-31 18:27:56 +0000
commit2a505cbe633b30afd7b10d655e000617b4a4ede9 (patch)
treec96e3db02862898b015b9ce944deb1b83492bb61
parentb2ef1cf67fc894343a7bf5579605049fbffabfa2 (diff)
Fix shutdown bug in timer thread pool
-rw-r--r--src/core/lib/iomgr/timer_manager.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/timer_manager.c b/src/core/lib/iomgr/timer_manager.c
index 767bb64961..5fb3102f38 100644
--- a/src/core/lib/iomgr/timer_manager.c
+++ b/src/core/lib/iomgr/timer_manager.c
@@ -143,7 +143,10 @@ static bool wait_until(gpr_timespec next) {
const gpr_timespec inf_future = gpr_inf_future(GPR_CLOCK_MONOTONIC);
gpr_mu_lock(&g_mu);
// if we're not threaded anymore, leave
- if (!g_threaded) return false;
+ if (!g_threaded) {
+ gpr_mu_unlock(&g_mu);
+ return false;
+ }
// if there's no timed waiter, we should become one: that waiter waits
// only until the next timer should expire
// all other timers wait forever