From c212e6cc5e005526a80320ac95424e46dd341ad5 Mon Sep 17 00:00:00 2001
From: Craig Tiller <ctiller@google.com>
Date: Thu, 30 Mar 2017 08:26:21 -0700
Subject: [PATCH] Fix barrier, comment

---
 src/core/lib/iomgr/ev_epoll_linux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/lib/iomgr/ev_epoll_linux.c b/src/core/lib/iomgr/ev_epoll_linux.c
index 97f8f82fed..f6372c0f3f 100644
--- a/src/core/lib/iomgr/ev_epoll_linux.c
+++ b/src/core/lib/iomgr/ev_epoll_linux.c
@@ -1173,9 +1173,9 @@ static void set_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd, gpr_atm *state,
     switch (curr) {
       case CLOSURE_READY:
       case CLOSURE_NOT_READY:
-        /* Release cas to pair with a set_ready performing a load of the
-           shutdown state later */
-        if (gpr_atm_rel_cas(state, curr, new_state)) {
+        /* Need a full barrier here so that the initial load in notify_on
+           doesn't need a barrier */
+        if (gpr_atm_full_cas(state, curr, new_state)) {
           return; /* early out */
         }
         break; /* retry */
-- 
GitLab