|
|
|
@ -767,8 +767,8 @@ static void unref_by(grpc_fd* fd, int n) { |
|
|
|
|
fd_freelist = fd; |
|
|
|
|
grpc_iomgr_unregister_object(&fd->iomgr_object); |
|
|
|
|
|
|
|
|
|
fd->read_closure.Destroy(); |
|
|
|
|
fd->write_closure.Destroy(); |
|
|
|
|
fd->read_closure->Destroy(); |
|
|
|
|
fd->write_closure->Destroy(); |
|
|
|
|
|
|
|
|
|
gpr_mu_unlock(&fd_freelist_mu); |
|
|
|
|
} else { |
|
|
|
@ -819,6 +819,8 @@ static grpc_fd* fd_create(int fd, const char* name) { |
|
|
|
|
if (new_fd == nullptr) { |
|
|
|
|
new_fd = (grpc_fd*)gpr_malloc(sizeof(grpc_fd)); |
|
|
|
|
gpr_mu_init(&new_fd->po.mu); |
|
|
|
|
new_fd->read_closure.Init(); |
|
|
|
|
new_fd->write_closure.Init(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Note: It is not really needed to get the new_fd->po.mu lock here. If this
|
|
|
|
@ -833,8 +835,8 @@ static grpc_fd* fd_create(int fd, const char* name) { |
|
|
|
|
gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1); |
|
|
|
|
new_fd->fd = fd; |
|
|
|
|
new_fd->orphaned = false; |
|
|
|
|
new_fd->read_closure.Init(); |
|
|
|
|
new_fd->write_closure.Init(); |
|
|
|
|
new_fd->read_closure->Init(); |
|
|
|
|
new_fd->write_closure->Init(); |
|
|
|
|
gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL); |
|
|
|
|
|
|
|
|
|
new_fd->freelist_next = nullptr; |
|
|
|
|