Merge pull request #16729 from AspirinSJL/comment_ev

Add TODO in fd_global_shutdown()
pull/15223/head
Juanli Shen 7 years ago committed by GitHub
commit cd41e6936e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/core/lib/iomgr/ev_epoll1_linux.cc
  2. 4
      src/core/lib/iomgr/ev_epollex_linux.cc

@ -273,6 +273,10 @@ static gpr_mu fork_fd_list_mu;
static void fd_global_init(void) { gpr_mu_init(&fd_freelist_mu); }
static void fd_global_shutdown(void) {
// TODO(guantaol): We don't have a reasonable explanation about this
// lock()/unlock() pattern. It can be a valid barrier if there is at most one
// pending lock() at this point. Otherwise, there is still a possibility of
// use-after-free race. Need to reason about the code and/or clean it up.
gpr_mu_lock(&fd_freelist_mu);
gpr_mu_unlock(&fd_freelist_mu);
while (fd_freelist != nullptr) {

@ -403,6 +403,10 @@ static void unref_by(grpc_fd* fd, int n) {
static void fd_global_init(void) { gpr_mu_init(&fd_freelist_mu); }
static void fd_global_shutdown(void) {
// TODO(guantaol): We don't have a reasonable explanation about this
// lock()/unlock() pattern. It can be a valid barrier if there is at most one
// pending lock() at this point. Otherwise, there is still a possibility of
// use-after-free race. Need to reason about the code and/or clean it up.
gpr_mu_lock(&fd_freelist_mu);
gpr_mu_unlock(&fd_freelist_mu);
while (fd_freelist != nullptr) {

Loading…
Cancel
Save