Lines Matching refs:bg
85 bg_watched_channel* bg; member
93 bg_watched_channel* bg);
110 static int bg_watched_channel_list_lookup(bg_watched_channel* bg);
113 static void bg_watched_channel_list_free_and_remove(bg_watched_channel* bg);
127 static void grpc_rb_channel_safe_destroy(bg_watched_channel* bg) { in grpc_rb_channel_safe_destroy() argument
129 GPR_ASSERT(bg_watched_channel_list_lookup(bg)); in grpc_rb_channel_safe_destroy()
130 if (!bg->channel_destroyed) { in grpc_rb_channel_safe_destroy()
131 grpc_channel_destroy(bg->channel); in grpc_rb_channel_safe_destroy()
132 bg->channel_destroyed = 1; in grpc_rb_channel_safe_destroy()
134 bg->refcount--; in grpc_rb_channel_safe_destroy()
135 if (bg->refcount == 0) { in grpc_rb_channel_safe_destroy()
136 bg_watched_channel_list_free_and_remove(bg); in grpc_rb_channel_safe_destroy()
266 bg_watched_channel* bg; member
276 if (stack->bg->channel_destroyed) { in get_state_without_gil()
279 stack->out = grpc_channel_check_connectivity_state(stack->bg->channel, in get_state_without_gil()
311 stack.bg = wrapper->bg_wrapped; in grpc_rb_channel_get_connectivity_state()
355 bg_watched_channel* bg = (bg_watched_channel*)arg; in wait_for_watch_state_op_complete_unblocking_func() local
357 if (!bg->channel_destroyed) { in wait_for_watch_state_op_complete_unblocking_func()
358 grpc_channel_destroy(bg->channel); in wait_for_watch_state_op_complete_unblocking_func()
359 bg->channel_destroyed = 1; in wait_for_watch_state_op_complete_unblocking_func()
526 bg_watched_channel* bg = NULL; in bg_watched_channel_list_free_and_remove() local
535 bg = bg_watched_channel_list_head; in bg_watched_channel_list_free_and_remove()
536 while (bg != NULL && bg->next != NULL) { in bg_watched_channel_list_free_and_remove()
537 if (bg->next == target) { in bg_watched_channel_list_free_and_remove()
538 bg->next = bg->next->next; in bg_watched_channel_list_free_and_remove()
542 bg = bg->next; in bg_watched_channel_list_free_and_remove()
564 bg_watched_channel* bg) { in grpc_rb_channel_try_register_connection_polling() argument
570 if (bg->refcount == 0) { in grpc_rb_channel_try_register_connection_polling()
571 GPR_ASSERT(bg->channel_destroyed); in grpc_rb_channel_try_register_connection_polling()
572 bg_watched_channel_list_free_and_remove(bg); in grpc_rb_channel_try_register_connection_polling()
575 GPR_ASSERT(bg->refcount == 1); in grpc_rb_channel_try_register_connection_polling()
576 if (bg->channel_destroyed || abort_channel_polling) { in grpc_rb_channel_try_register_connection_polling()
580 conn_state = grpc_channel_check_connectivity_state(bg->channel, 0); in grpc_rb_channel_try_register_connection_polling()
584 GPR_ASSERT(bg_watched_channel_list_lookup(bg)); in grpc_rb_channel_try_register_connection_polling()
586 bg->refcount++; in grpc_rb_channel_try_register_connection_polling()
590 op->op.continuous_watch_callback_args.bg = bg; in grpc_rb_channel_try_register_connection_polling()
591 grpc_channel_watch_connectivity_state(bg->channel, conn_state, in grpc_rb_channel_try_register_connection_polling()
605 bg_watched_channel* bg = NULL; in run_poll_channels_loop_no_gil() local
625 bg = (bg_watched_channel*)op->op.continuous_watch_callback_args.bg; in run_poll_channels_loop_no_gil()
626 bg->refcount--; in run_poll_channels_loop_no_gil()
627 grpc_rb_channel_try_register_connection_polling(bg); in run_poll_channels_loop_no_gil()
647 bg_watched_channel* bg = NULL; in run_poll_channels_loop_unblocking_func() local
662 bg = bg_watched_channel_list_head; in run_poll_channels_loop_unblocking_func()
663 while (bg != NULL) { in run_poll_channels_loop_unblocking_func()
664 if (!bg->channel_destroyed) { in run_poll_channels_loop_unblocking_func()
665 grpc_channel_destroy(bg->channel); in run_poll_channels_loop_unblocking_func()
666 bg->channel_destroyed = 1; in run_poll_channels_loop_unblocking_func()
668 bg = bg->next; in run_poll_channels_loop_unblocking_func()