diff options
author | Craig Tiller <ctiller@google.com> | 2017-03-07 16:21:55 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-03-07 16:21:55 -0800 |
commit | 144446434507dcc6d4583a04e723904df5cd2718 (patch) | |
tree | 816c9caed0e5b547c256f7815567eab22f61b132 /src/core | |
parent | 702a445dc199bd3308bbb70b94ef50386cedd215 (diff) |
Fix locking
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lib/iomgr/tcp_server_posix.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.c index a17f6d48ef..5f286a6723 100644 --- a/src/core/lib/iomgr/tcp_server_posix.c +++ b/src/core/lib/iomgr/tcp_server_posix.c @@ -424,12 +424,14 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *err) { grpc_fd_notify_on_read(exec_ctx, sp->emfd, &sp->read_closure); return; default: + gpr_mu_lock(&sp->server->mu); if (!sp->server->shutdown_listeners) { gpr_log(GPR_ERROR, "Failed accept4: %s", strerror(errno)); } else { /* if we have shutdown listeners, accept4 could fail, and we needn't notify users */ } + gpr_mu_unlock(&sp->server->mu); goto error; } } |