void grpc_fd_orphan(grpc_fd *fd, grpc_iomgr_cb_func on_done, void *user_data) { grpc_iomgr_closure_init(&fd->on_done_closure, on_done ? on_done : do_nothing, user_data); shutdown(fd->fd, SHUT_RDWR); ref_by(fd, 1); /* remove active status, but keep referenced */ gpr_mu_lock(&fd->watcher_mu); wake_all_watchers_locked(fd); gpr_mu_unlock(&fd->watcher_mu); unref_by(fd, 2); /* drop the reference */ }
void grpc_fd_unref(grpc_fd *fd) { unref_by(fd, 2); }
void grpc_fd_unref(grpc_fd *fd, const char *reason, const char *file, int line) { unref_by(fd, 2, reason, file, line); }