aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/ev_epoll1_linux.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2018-06-08 14:10:14 -0700
committerGravatar Yash Tibrewal <yashkt@google.com>2018-06-08 14:10:14 -0700
commit935ae7d01242c21f0230ead18927087a70c03e5b (patch)
tree98ce8490adf095e4e1255f9af00e78d56640b583 /src/core/lib/iomgr/ev_epoll1_linux.cc
parent21e360382f7f022aed6cdd2522ebc33aaf6d7436 (diff)
More comments
Diffstat (limited to 'src/core/lib/iomgr/ev_epoll1_linux.cc')
-rw-r--r--src/core/lib/iomgr/ev_epoll1_linux.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc
index 1c495b47bc..554522598c 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.cc
+++ b/src/core/lib/iomgr/ev_epoll1_linux.cc
@@ -311,7 +311,9 @@ static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
ev.events = static_cast<uint32_t>(EPOLLIN | EPOLLOUT | EPOLLET);
/* Use the least significant bit of ev.data.ptr to store track_err. We expect
* the addresses to be word aligned. We need to store track_err to avoid
- * synchronization issues when accessing it after receiving an event. */
+ * synchronization issues when accessing it after receiving an event.
+ * Accessing fd would be a data race there because the fd might have been
+ * returned to the free list at that point. */
ev.data.ptr = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(new_fd) |
(track_err ? 1 : 0));
if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_ADD, fd, &ev) != 0) {