diff options
author | Craig Tiller <ctiller@google.com> | 2017-04-21 16:41:34 +0000 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-04-21 16:41:34 +0000 |
commit | c8d9b9c3437ad799a718db171a665b0bc094ad38 (patch) | |
tree | b8d4fa6650602bc8bdba7292ce27f3f0be50b039 | |
parent | 0bf244769910fdc9f467bd531c82d58bc7941500 (diff) |
Fix deadlock
-rw-r--r-- | src/core/lib/iomgr/ev_epollex_linux.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/ev_epollex_linux.c b/src/core/lib/iomgr/ev_epollex_linux.c index 4000d0445f..3a0335ace0 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.c +++ b/src/core/lib/iomgr/ev_epollex_linux.c @@ -665,7 +665,9 @@ static grpc_error *pollset_kick_all(grpc_pollset *pollset) { if (pollset->root_worker != NULL) { grpc_pollset_worker *worker = pollset->root_worker; do { - gpr_mu_lock(&worker->pollable->po.mu); + if (worker->pollable != &pollset->pollable) { + gpr_mu_lock(&worker->pollable->po.mu); + } if (worker->initialized_cv) { worker->kicked = true; gpr_cv_signal(&worker->cv); @@ -673,7 +675,9 @@ static grpc_error *pollset_kick_all(grpc_pollset *pollset) { append_error(&error, grpc_wakeup_fd_wakeup(&worker->pollable->wakeup), "pollset_shutdown"); } - gpr_mu_unlock(&worker->pollable->po.mu); + if (worker->pollable != &pollset->pollable) { + gpr_mu_unlock(&worker->pollable->po.mu); + } worker = worker->links[PWL_POLLSET].next; } while (worker != pollset->root_worker); |