aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-09-14 15:36:41 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-09-14 15:36:41 -0700
commit1d3f127245b38a1f497ecbd4cd9a03b6791674be (patch)
tree0e8169a8f4afe2db384c0e16dfbb1cdf986a11cd /src
parentf52884cc5b0cf0001c41c143dc32a0446376b354 (diff)
Fix a race in fd_posix.c
Diffstat (limited to 'src')
-rw-r--r--src/core/iomgr/fd_posix.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/core/iomgr/fd_posix.c b/src/core/iomgr/fd_posix.c
index 2d08a77a70..38a543e36e 100644
--- a/src/core/iomgr/fd_posix.c
+++ b/src/core/iomgr/fd_posix.c
@@ -213,10 +213,9 @@ void grpc_fd_orphan(grpc_fd *fd, grpc_iomgr_closure *on_done,
const char *reason) {
fd->on_done_closure = on_done;
shutdown(fd->fd, SHUT_RDWR);
- REF_BY(fd, 1, reason); /* remove active status, but keep referenced */
gpr_mu_lock(&fd->watcher_mu);
+ REF_BY(fd, 1, reason); /* remove active status, but keep referenced */
if (!has_watchers(fd)) {
- GPR_ASSERT(!fd->closed);
fd->closed = 1;
close(fd->fd);
if (fd->on_done_closure) {