Пример #1
0
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 */
}
Пример #2
0
/* increment refcount by two to avoid changing the orphan bit */
void grpc_fd_ref(grpc_fd *fd) { ref_by(fd, 2); }
Пример #3
0
void grpc_fd_ref(grpc_fd *fd, const char *reason, const char *file, int line) {
  ref_by(fd, 2, reason, file, line);
}