int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_iomgr_init(); test_grpc_fd(); test_grpc_fd_change(); grpc_iomgr_shutdown(); return 0; }
int main(int argc, char **argv) { grpc_closure destroyed; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_test_init(argc, argv); grpc_iomgr_init(&exec_ctx); grpc_iomgr_start(&exec_ctx); g_pollset = gpr_zalloc(grpc_pollset_size()); grpc_pollset_init(g_pollset, &g_mu); test_grpc_fd(); test_grpc_fd_change(); GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset, grpc_schedule_on_exec_ctx); grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed); grpc_exec_ctx_flush(&exec_ctx); gpr_free(g_pollset); grpc_iomgr_shutdown(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx); return 0; }