From afbae1f583b9b34b60a975c0cee7b336399ade8b Mon Sep 17 00:00:00 2001
From: Craig Tiller <ctiller@google.com>
Date: Mon, 28 Mar 2016 22:59:51 -0700
Subject: [PATCH] Fix mutex

---
 src/core/lib/iomgr/ev_poll_and_epoll_posix.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
index beccb9e89f..dba335490b 100644
--- a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
+++ b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
@@ -329,6 +329,7 @@ static grpc_fd *alloc_fd(int fd) {
     gpr_mu_init(&r->mu);
   }
 
+  gpr_mu_lock(&r->mu);
   gpr_atm_rel_store(&r->refst, 1);
   r->shutdown = 0;
   r->read_closure = CLOSURE_NOT_READY;
@@ -341,6 +342,7 @@ static grpc_fd *alloc_fd(int fd) {
   r->on_done_closure = NULL;
   r->closed = 0;
   r->released = 0;
+  gpr_mu_unlock(&r->mu);
   return r;
 }
 
-- 
GitLab