diff options
author | Craig Tiller <ctiller@google.com> | 2015-09-22 10:45:28 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-09-22 10:45:28 -0700 |
commit | 1be70ccdb84ec41975cc018f6b2a2a89cf5072ee (patch) | |
tree | d4e6890ca32762bf786e2b801d3c26b27ec707ee /src | |
parent | 45724b35e411fef7c5da66a74c78428c11d56843 (diff) |
Move arguments to the start of lists
Diffstat (limited to 'src')
106 files changed, 642 insertions, 642 deletions
diff --git a/src/core/census/grpc_filter.c b/src/core/census/grpc_filter.c index 5e9822dd73..eed9523d72 100644 --- a/src/core/census/grpc_filter.c +++ b/src/core/census/grpc_filter.c @@ -96,14 +96,14 @@ client_mutate_op (grpc_call_element * elem, grpc_transport_stream_op * op) } static void -client_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +client_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { client_mutate_op (elem, op); grpc_call_next_op (elem, op, closure_list); } static void -server_on_done_recv (void *ptr, int success, grpc_closure_list * closure_list) +server_on_done_recv (grpc_exec_ctx * exec_ctx, void *ptr, int success) { grpc_call_element *elem = ptr; call_data *calld = elem->call_data; @@ -129,7 +129,7 @@ server_mutate_op (grpc_call_element * elem, grpc_transport_stream_op * op) } static void -server_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +server_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { call_data *calld = elem->call_data; GPR_ASSERT ((calld->op_id.upper != 0) || (calld->op_id.lower != 0)); @@ -138,7 +138,7 @@ server_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * } static void -client_init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +client_init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { call_data *d = elem->call_data; GPR_ASSERT (d != NULL); @@ -148,7 +148,7 @@ client_init_call_elem (grpc_call_element * elem, const void *server_transport_da } static void -client_destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +client_destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { call_data *d = elem->call_data; GPR_ASSERT (d != NULL); @@ -156,7 +156,7 @@ client_destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_ } static void -server_init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +server_init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { call_data *d = elem->call_data; GPR_ASSERT (d != NULL); @@ -168,7 +168,7 @@ server_init_call_elem (grpc_call_element * elem, const void *server_transport_da } static void -server_destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +server_destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { call_data *d = elem->call_data; GPR_ASSERT (d != NULL); @@ -176,7 +176,7 @@ server_destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_ } static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last) { channel_data *chand = elem->channel_data; GPR_ASSERT (chand != NULL); @@ -184,7 +184,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp } static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { channel_data *chand = elem->channel_data; GPR_ASSERT (chand != NULL); diff --git a/src/core/channel/channel_stack.c b/src/core/channel/channel_stack.c index aafc0ede9c..07b118f74a 100644 --- a/src/core/channel/channel_stack.c +++ b/src/core/channel/channel_stack.c @@ -104,7 +104,7 @@ grpc_call_stack_element (grpc_call_stack * call_stack, size_t index) } void -grpc_channel_stack_init (const grpc_channel_filter ** filters, size_t filter_count, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, grpc_channel_stack * stack, grpc_closure_list * closure_list) +grpc_channel_stack_init (grpc_exec_ctx * exec_ctx, const grpc_channel_filter ** filters, size_t filter_count, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, grpc_channel_stack * stack) { size_t call_size = ROUND_UP_TO_ALIGNMENT_SIZE (sizeof (grpc_call_stack)) + ROUND_UP_TO_ALIGNMENT_SIZE (filter_count * sizeof (grpc_call_element)); grpc_channel_element *elems; @@ -132,7 +132,7 @@ grpc_channel_stack_init (const grpc_channel_filter ** filters, size_t filter_cou } void -grpc_channel_stack_destroy (grpc_channel_stack * stack, grpc_closure_list * closure_list) +grpc_channel_stack_destroy (grpc_exec_ctx * exec_ctx, grpc_channel_stack * stack) { grpc_channel_element *channel_elems = CHANNEL_ELEMS_FROM_STACK (stack); size_t count = stack->count; @@ -146,7 +146,7 @@ grpc_channel_stack_destroy (grpc_channel_stack * stack, grpc_closure_list * clos } void -grpc_call_stack_init (grpc_channel_stack * channel_stack, const void *transport_server_data, grpc_transport_stream_op * initial_op, grpc_call_stack * call_stack, grpc_closure_list * closure_list) +grpc_call_stack_init (grpc_exec_ctx * exec_ctx, grpc_channel_stack * channel_stack, const void *transport_server_data, grpc_transport_stream_op * initial_op, grpc_call_stack * call_stack) { grpc_channel_element *channel_elems = CHANNEL_ELEMS_FROM_STACK (channel_stack); size_t count = channel_stack->count; @@ -170,7 +170,7 @@ grpc_call_stack_init (grpc_channel_stack * channel_stack, const void *transport_ } void -grpc_call_stack_destroy (grpc_call_stack * stack, grpc_closure_list * closure_list) +grpc_call_stack_destroy (grpc_exec_ctx * exec_ctx, grpc_call_stack * stack) { grpc_call_element *elems = CALL_ELEMS_FROM_STACK (stack); size_t count = stack->count; @@ -184,21 +184,21 @@ grpc_call_stack_destroy (grpc_call_stack * stack, grpc_closure_list * closure_li } void -grpc_call_next_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +grpc_call_next_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { grpc_call_element *next_elem = elem + 1; next_elem->filter->start_transport_stream_op (next_elem, op, closure_list); } char * -grpc_call_next_get_peer (grpc_call_element * elem, grpc_closure_list * closure_list) +grpc_call_next_get_peer (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { grpc_call_element *next_elem = elem + 1; return next_elem->filter->get_peer (next_elem, closure_list); } void -grpc_channel_next_op (grpc_channel_element * elem, grpc_transport_op * op, grpc_closure_list * closure_list) +grpc_channel_next_op (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_transport_op * op) { grpc_channel_element *next_elem = elem + 1; next_elem->filter->start_transport_op (next_elem, op, closure_list); @@ -217,7 +217,7 @@ grpc_call_stack_from_top_element (grpc_call_element * elem) } void -grpc_call_element_send_cancel (grpc_call_element * cur_elem, grpc_closure_list * closure_list) +grpc_call_element_send_cancel (grpc_exec_ctx * exec_ctx, grpc_call_element * cur_elem) { grpc_transport_stream_op op; memset (&op, 0, sizeof (op)); diff --git a/src/core/channel/channel_stack.h b/src/core/channel/channel_stack.h index 937bb04eda..0bfe326976 100644 --- a/src/core/channel/channel_stack.h +++ b/src/core/channel/channel_stack.h @@ -65,11 +65,11 @@ typedef struct { /* Called to eg. send/receive data on a call. See grpc_call_next_op on how to call the next element in the stack */ - void (*start_transport_stream_op) (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list); + void (*start_transport_stream_op) (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op); /* Called to handle channel level operations - e.g. new calls, or transport closure. See grpc_channel_next_op on how to call the next element in the stack */ - void (*start_transport_op) (grpc_channel_element * elem, grpc_transport_op * op, grpc_closure_list * closure_list); + void (*start_transport_op) (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_transport_op * op); /* sizeof(per call data) */ size_t sizeof_call_data; @@ -81,10 +81,10 @@ typedef struct on a client; if it is non-NULL, then it points to memory owned by the transport and is on the server. Most filters want to ignore this argument. */ - void (*init_call_elem) (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list); + void (*init_call_elem) (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op); /* Destroy per call data. The filter does not need to do any chaining */ - void (*destroy_call_elem) (grpc_call_element * elem, grpc_closure_list * closure_list); + void (*destroy_call_elem) (grpc_exec_ctx * exec_ctx, grpc_call_element * elem); /* sizeof(per channel data) */ size_t sizeof_channel_data; @@ -94,13 +94,13 @@ typedef struct is_first, is_last designate this elements position in the stack, and are useful for asserting correct configuration by upper layer code. The filter does not need to do any chaining */ - void (*init_channel_elem) (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, int is_first, int is_last, grpc_closure_list * closure_list); + void (*init_channel_elem) (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, int is_first, int is_last); /* Destroy per channel data. The filter does not need to do any chaining */ - void (*destroy_channel_elem) (grpc_channel_element * elem, grpc_closure_list * closure_list); + void (*destroy_channel_elem) (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem); /* Implement grpc_call_get_peer() */ - char *(*get_peer) (grpc_call_element * elem, grpc_closure_list * closure_list); + char *(*get_peer) (grpc_exec_ctx * exec_ctx, grpc_call_element * elem); /* The name of this filter */ const char *name; @@ -151,24 +151,24 @@ grpc_call_element *grpc_call_stack_element (grpc_call_stack * stack, size_t i); /* Determine memory required for a channel stack containing a set of filters */ size_t grpc_channel_stack_size (const grpc_channel_filter ** filters, size_t filter_count); /* Initialize a channel stack given some filters */ -void grpc_channel_stack_init (const grpc_channel_filter ** filters, size_t filter_count, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, grpc_channel_stack * stack, grpc_closure_list * closure_list); +void grpc_channel_stack_init (grpc_exec_ctx * exec_ctx, const grpc_channel_filter ** filters, size_t filter_count, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, grpc_channel_stack * stack); /* Destroy a channel stack */ -void grpc_channel_stack_destroy (grpc_channel_stack * stack, grpc_closure_list * closure_list); +void grpc_channel_stack_destroy (grpc_exec_ctx * exec_ctx, grpc_channel_stack * stack); /* Initialize a call stack given a channel stack. transport_server_data is expected to be NULL on a client, or an opaque transport owned pointer on the server. */ -void grpc_call_stack_init (grpc_channel_stack * channel_stack, const void *transport_server_data, grpc_transport_stream_op * initial_op, grpc_call_stack * call_stack, grpc_closure_list * closure_list); +void grpc_call_stack_init (grpc_exec_ctx * exec_ctx, grpc_channel_stack * channel_stack, const void *transport_server_data, grpc_transport_stream_op * initial_op, grpc_call_stack * call_stack); /* Destroy a call stack */ -void grpc_call_stack_destroy (grpc_call_stack * stack, grpc_closure_list * closure_list); +void grpc_call_stack_destroy (grpc_exec_ctx * exec_ctx, grpc_call_stack * stack); /* Call the next operation in a call stack */ -void grpc_call_next_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list); +void grpc_call_next_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op); /* Call the next operation (depending on call directionality) in a channel stack */ -void grpc_channel_next_op (grpc_channel_element * elem, grpc_transport_op * op, grpc_closure_list * closure_list); +void grpc_channel_next_op (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_transport_op * op); /* Pass through a request to get_peer to the next child element */ -char *grpc_call_next_get_peer (grpc_call_element * elem, grpc_closure_list * closure_list); +char *grpc_call_next_get_peer (grpc_exec_ctx * exec_ctx, grpc_call_element * elem); /* Given the top element of a channel stack, get the channel stack itself */ grpc_channel_stack *grpc_channel_stack_from_top_element (grpc_channel_element * elem); @@ -177,7 +177,7 @@ grpc_call_stack *grpc_call_stack_from_top_element (grpc_call_element * elem); void grpc_call_log_op (char *file, int line, gpr_log_severity severity, grpc_call_element * elem, grpc_transport_stream_op * op); -void grpc_call_element_send_cancel (grpc_call_element * cur_elem, grpc_closure_list * closure_list); +void grpc_call_element_send_cancel (grpc_exec_ctx * exec_ctx, grpc_call_element * cur_elem); extern int grpc_trace_channel; diff --git a/src/core/channel/client_channel.c b/src/core/channel/client_channel.c index 40b428cf3e..d0be3ca7b6 100644 --- a/src/core/channel/client_channel.c +++ b/src/core/channel/client_channel.c @@ -131,7 +131,7 @@ static grpc_closure * merge_into_waiting_op (grpc_call_element * elem, grpc_transport_stream_op * new_op) GRPC_MUST_USE_RESULT; - static void handle_op_after_cancellation (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) + static void handle_op_after_cancellation (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; @@ -170,10 +170,10 @@ typedef struct grpc_call_element *elem; } waiting_call; -static void perform_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_op * op, int continuation, grpc_closure_list * closure_list); +static void perform_transport_stream_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op, int continuation); static void -continue_with_pick (void *arg, int iomgr_success, grpc_closure_list * closure_list) +continue_with_pick (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success) { waiting_call *wc = arg; call_data *calld = wc->elem->call_data; @@ -205,7 +205,7 @@ is_empty (void *p, int len) } static void -started_call (void *arg, int iomgr_success, grpc_closure_list * closure_list) +started_call (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success) { call_data *calld = arg; grpc_transport_stream_op op; @@ -249,7 +249,7 @@ started_call (void *arg, int iomgr_success, grpc_closure_list * closure_list) } static void -picked_target (void *arg, int iomgr_success, grpc_closure_list * closure_list) +picked_target (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success) { call_data *calld = arg; grpc_pollset *pollset; @@ -316,7 +316,7 @@ merge_into_waiting_op (grpc_call_element * elem, grpc_transport_stream_op * new_ } static char * -cc_get_peer (grpc_call_element * elem, grpc_closure_list * closure_list) +cc_get_peer (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; @@ -341,7 +341,7 @@ cc_get_peer (grpc_call_element * elem, grpc_closure_list * closure_list) } static void -perform_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_op * op, int continuation, grpc_closure_list * closure_list) +perform_transport_stream_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op, int continuation) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; @@ -477,7 +477,7 @@ perform_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_op } static void -cc_start_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +cc_start_transport_stream_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { perform_transport_stream_op (elem, op, 0, closure_list); } @@ -499,7 +499,7 @@ on_lb_policy_state_changed_locked (lb_policy_connectivity_watcher * w, grpc_clos } static void -on_lb_policy_state_changed (void *arg, int iomgr_success, grpc_closure_list * closure_list) +on_lb_policy_state_changed (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success) { lb_policy_connectivity_watcher *w = arg; @@ -512,7 +512,7 @@ on_lb_policy_state_changed (void *arg, int iomgr_success, grpc_closure_list * cl } static void -watch_lb_policy (channel_data * chand, grpc_lb_policy * lb_policy, grpc_connectivity_state current_state, grpc_closure_list * closure_list) +watch_lb_policy (grpc_exec_ctx * exec_ctx, channel_data * chand, grpc_lb_policy * lb_policy, grpc_connectivity_state current_state) { lb_policy_connectivity_watcher *w = gpr_malloc (sizeof (*w)); GRPC_CHANNEL_INTERNAL_REF (chand->master, "watch_lb_policy"); @@ -525,7 +525,7 @@ watch_lb_policy (channel_data * chand, grpc_lb_policy * lb_policy, grpc_connecti } static void -cc_on_config_changed (void *arg, int iomgr_success, grpc_closure_list * closure_list) +cc_on_config_changed (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success) { channel_data *chand = arg; grpc_lb_policy *lb_policy = NULL; @@ -611,7 +611,7 @@ cc_on_config_changed (void *arg, int iomgr_success, grpc_closure_list * closure_ } static void -cc_start_transport_op (grpc_channel_element * elem, grpc_transport_op * op, grpc_closure_list * closure_list) +cc_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_transport_op * op) { grpc_lb_policy *lb_policy = NULL; channel_data *chand = elem->channel_data; @@ -668,7 +668,7 @@ cc_start_transport_op (grpc_channel_element * elem, grpc_transport_op * op, grpc /* Constructor for call_data */ static void -init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { call_data *calld = elem->call_data; @@ -685,7 +685,7 @@ init_call_elem (grpc_call_element * elem, const void *server_transport_data, grp /* Destructor for call_data */ static void -destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { call_data *calld = elem->call_data; grpc_subchannel_call *subchannel_call; @@ -717,7 +717,7 @@ destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) /* Constructor for channel_data */ static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, int is_first, int is_last) { channel_data *chand = elem->channel_data; @@ -737,7 +737,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp /* Destructor for channel_data */ static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { channel_data *chand = elem->channel_data; @@ -769,7 +769,7 @@ const grpc_channel_filter grpc_client_channel_filter = { }; void -grpc_client_channel_set_resolver (grpc_channel_stack * channel_stack, grpc_resolver * resolver, grpc_closure_list * closure_list) +grpc_client_channel_set_resolver (grpc_exec_ctx * exec_ctx, grpc_channel_stack * channel_stack, grpc_resolver * resolver) { /* post construction initialization: set the transport setup pointer */ grpc_channel_element *elem = grpc_channel_stack_last_element (channel_stack); @@ -788,7 +788,7 @@ grpc_client_channel_set_resolver (grpc_channel_stack * channel_stack, grpc_resol } grpc_connectivity_state -grpc_client_channel_check_connectivity_state (grpc_channel_element * elem, int try_to_connect, grpc_closure_list * closure_list) +grpc_client_channel_check_connectivity_state (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, int try_to_connect) { channel_data *chand = elem->channel_data; grpc_connectivity_state out; @@ -816,7 +816,7 @@ grpc_client_channel_check_connectivity_state (grpc_channel_element * elem, int t } void -grpc_client_channel_watch_connectivity_state (grpc_channel_element * elem, grpc_connectivity_state * state, grpc_closure * on_complete, grpc_closure_list * closure_list) +grpc_client_channel_watch_connectivity_state (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_connectivity_state * state, grpc_closure * on_complete) { channel_data *chand = elem->channel_data; gpr_mu_lock (&chand->mu_config); @@ -832,14 +832,14 @@ grpc_client_channel_get_connecting_pollset_set (grpc_channel_element * elem) } void -grpc_client_channel_add_interested_party (grpc_channel_element * elem, grpc_pollset * pollset, grpc_closure_list * closure_list) +grpc_client_channel_add_interested_party (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_pollset * pollset) { channel_data *chand = elem->channel_data; grpc_pollset_set_add_pollset (&chand->pollset_set, pollset, closure_list); } void -grpc_client_channel_del_interested_party (grpc_channel_element * elem, grpc_pollset * pollset, grpc_closure_list * closure_list) +grpc_client_channel_del_interested_party (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_pollset * pollset) { channel_data *chand = elem->channel_data; grpc_pollset_set_del_pollset (&chand->pollset_set, pollset, closure_list); diff --git a/src/core/channel/client_channel.h b/src/core/channel/client_channel.h index 468cf5ef3e..5af9794727 100644 --- a/src/core/channel/client_channel.h +++ b/src/core/channel/client_channel.h @@ -49,15 +49,15 @@ extern const grpc_channel_filter grpc_client_channel_filter; /* post-construction initializer to let the client channel know which transport setup it should cancel upon destruction, or initiate when it needs a connection */ -void grpc_client_channel_set_resolver (grpc_channel_stack * channel_stack, grpc_resolver * resolver, grpc_closure_list * closure_list); +void grpc_client_channel_set_resolver (grpc_exec_ctx * exec_ctx, grpc_channel_stack * channel_stack, grpc_resolver * resolver); -grpc_connectivity_state grpc_client_channel_check_connectivity_state (grpc_channel_element * elem, int try_to_connect, grpc_closure_list * closure_list); +grpc_connectivity_state grpc_client_channel_check_connectivity_state (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, int try_to_connect); -void grpc_client_channel_watch_connectivity_state (grpc_channel_element * elem, grpc_connectivity_state * state, grpc_closure * on_complete, grpc_closure_list * closure_list); +void grpc_client_channel_watch_connectivity_state (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_connectivity_state * state, grpc_closure * on_complete); grpc_pollset_set *grpc_client_channel_get_connecting_pollset_set (grpc_channel_element * elem); -void grpc_client_channel_add_interested_party (grpc_channel_element * channel, grpc_pollset * pollset, grpc_closure_list * closure_list); -void grpc_client_channel_del_interested_party (grpc_channel_element * channel, grpc_pollset * pollset, grpc_closure_list * closure_list); +void grpc_client_channel_add_interested_party (grpc_exec_ctx * exec_ctx, grpc_channel_element * channel, grpc_pollset * pollset); +void grpc_client_channel_del_interested_party (grpc_exec_ctx * exec_ctx, grpc_channel_element * channel, grpc_pollset * pollset); #endif /* GRPC_INTERNAL_CORE_CHANNEL_CLIENT_CHANNEL_H */ diff --git a/src/core/channel/compress_filter.c b/src/core/channel/compress_filter.c index a1c03dc9d9..bf3c5a9457 100644 --- a/src/core/channel/compress_filter.c +++ b/src/core/channel/compress_filter.c @@ -275,7 +275,7 @@ process_send_ops (grpc_call_element * elem, grpc_stream_op_buffer * send_ops) op contains type and call direction information, in addition to the data that is being sent or received. */ static void -compress_start_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +compress_start_transport_stream_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { if (op->send_ops && op->send_ops->nops > 0) { @@ -288,7 +288,7 @@ compress_start_transport_stream_op (grpc_call_element * elem, grpc_transport_str /* Constructor for call_data */ static void -init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { /* grab pointers to our data from the call element */ call_data *calld = elem->call_data; @@ -309,7 +309,7 @@ init_call_elem (grpc_call_element * elem, const void *server_transport_data, grp /* Destructor for call_data */ static void -destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { /* grab pointers to our data from the call element */ call_data *calld = elem->call_data; @@ -318,7 +318,7 @@ destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) /* Constructor for channel_data */ static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last) { channel_data *channeld = elem->channel_data; grpc_compression_algorithm algo_idx; @@ -369,7 +369,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp /* Destructor for channel data */ static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { channel_data *channeld = elem->channel_data; grpc_compression_algorithm algo_idx; diff --git a/src/core/channel/connected_channel.c b/src/core/channel/connected_channel.c index 7ba412fe5c..2fd80d2207 100644 --- a/src/core/channel/connected_channel.c +++ b/src/core/channel/connected_channel.c @@ -66,7 +66,7 @@ typedef struct connected_channel_call_data /* Intercept a call operation and either push it directly up or translate it into transport stream operations */ static void -con_start_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +con_start_transport_stream_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; @@ -77,7 +77,7 @@ con_start_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_o } static void -con_start_transport_op (grpc_channel_element * elem, grpc_transport_op * op, grpc_closure_list * closure_list) +con_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_transport_op * op) { channel_data *chand = elem->channel_data; grpc_transport_perform_op (chand->transport, op, closure_list); @@ -85,7 +85,7 @@ con_start_transport_op (grpc_channel_element * elem, grpc_transport_op * op, grp /* Constructor for call_data */ static void -init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; @@ -98,7 +98,7 @@ init_call_elem (grpc_call_element * elem, const void *server_transport_data, grp /* Destructor for call_data */ static void -destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; @@ -108,7 +108,7 @@ destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) /* Constructor for channel_data */ static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last) { channel_data *cd = (channel_data *) elem->channel_data; GPR_ASSERT (is_last); @@ -118,7 +118,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp /* Destructor for channel_data */ static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { channel_data *cd = (channel_data *) elem->channel_data; GPR_ASSERT (elem->filter == &grpc_connected_channel_filter); @@ -126,7 +126,7 @@ destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_l } static char * -con_get_peer (grpc_call_element * elem, grpc_closure_list * closure_list) +con_get_peer (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { channel_data *chand = elem->channel_data; return grpc_transport_get_peer (chand->transport, closure_list); diff --git a/src/core/channel/http_client_filter.c b/src/core/channel/http_client_filter.c index 1a166833e7..b2cc69bb4a 100644 --- a/src/core/channel/http_client_filter.c +++ b/src/core/channel/http_client_filter.c @@ -98,7 +98,7 @@ client_recv_filter (void *user_data, grpc_mdelem * md) } static void -hc_on_recv (void *user_data, int success, grpc_closure_list * closure_list) +hc_on_recv (grpc_exec_ctx * exec_ctx, void *user_data, int success) { grpc_call_element *elem = user_data; call_data *calld = elem->call_data; @@ -177,7 +177,7 @@ hc_mutate_op (grpc_call_element * elem, grpc_transport_stream_op * op) } static void -hc_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +hc_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { GRPC_CALL_LOG_OP (GPR_INFO, elem, op); hc_mutate_op (elem, op); @@ -186,7 +186,7 @@ hc_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * op, /* Constructor for call_data */ static void -init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { call_data *calld = elem->call_data; calld->sent_initial_metadata = 0; @@ -199,7 +199,7 @@ init_call_elem (grpc_call_element * elem, const void *server_transport_data, grp /* Destructor for call_data */ static void -destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { } @@ -281,7 +281,7 @@ user_agent_from_args (grpc_mdctx * mdctx, const grpc_channel_args * args) /* Constructor for channel_data */ static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * channel_args, grpc_mdctx * mdctx, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * channel_args, grpc_mdctx * mdctx, int is_first, int is_last) { /* grab pointers to our data from the channel element */ channel_data *channeld = elem->channel_data; @@ -302,7 +302,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp /* Destructor for channel data */ static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { /* grab pointers to our data from the channel element */ channel_data *channeld = elem->channel_data; diff --git a/src/core/channel/http_server_filter.c b/src/core/channel/http_server_filter.c index 949868b403..62be4167f7 100644 --- a/src/core/channel/http_server_filter.c +++ b/src/core/channel/http_server_filter.c @@ -169,7 +169,7 @@ server_filter (void *user_data, grpc_mdelem * md) } static void -hs_on_recv (void *user_data, int success, grpc_closure_list * closure_list) +hs_on_recv (grpc_exec_ctx * exec_ctx, void *user_data, int success) { grpc_call_element *elem = user_data; call_data *calld = elem->call_data; @@ -260,7 +260,7 @@ hs_mutate_op (grpc_call_element * elem, grpc_transport_stream_op * op) } static void -hs_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +hs_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { GRPC_CALL_LOG_OP (GPR_INFO, elem, op); hs_mutate_op (elem, op); @@ -269,7 +269,7 @@ hs_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * op, /* Constructor for call_data */ static void -init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { /* grab pointers to our data from the call element */ call_data *calld = elem->call_data; @@ -282,13 +282,13 @@ init_call_elem (grpc_call_element * elem, const void *server_transport_data, grp /* Destructor for call_data */ static void -destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { } /* Constructor for channel_data */ static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last) { /* grab pointers to our data from the channel element */ channel_data *channeld = elem->channel_data; @@ -317,7 +317,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp /* Destructor for channel data */ static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { /* grab pointers to our data from the channel element */ channel_data *channeld = elem->channel_data; diff --git a/src/core/channel/noop_filter.c b/src/core/channel/noop_filter.c index a93497c509..3a3f1254bd 100644 --- a/src/core/channel/noop_filter.c +++ b/src/core/channel/noop_filter.c @@ -69,7 +69,7 @@ noop_mutate_op (grpc_call_element * elem, grpc_transport_stream_op * op) op contains type and call direction information, in addition to the data that is being sent or received. */ static void -noop_start_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +noop_start_transport_stream_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { noop_mutate_op (elem, op); @@ -79,7 +79,7 @@ noop_start_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_ /* Constructor for call_data */ static void -init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { /* grab pointers to our data from the call element */ call_data *calld = elem->call_data; @@ -94,13 +94,13 @@ init_call_elem (grpc_call_element * elem, const void *server_transport_data, grp /* Destructor for call_data */ static void -destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { } /* Constructor for channel_data */ static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last) { /* grab pointers to our data from the channel element */ channel_data *channeld = elem->channel_data; @@ -117,7 +117,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp /* Destructor for channel data */ static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { /* grab pointers to our data from the channel element */ channel_data *channeld = elem->channel_data; diff --git a/src/core/client_config/client_config.c b/src/core/client_config/client_config.c index 69d52be70b..ceb52e93e5 100644 --- a/src/core/client_config/client_config.c +++ b/src/core/client_config/client_config.c @@ -59,7 +59,7 @@ grpc_client_config_ref (grpc_client_config * c) } void -grpc_client_config_unref (grpc_client_config * c, grpc_closure_list * closure_list) +grpc_client_config_unref (grpc_exec_ctx * exec_ctx, grpc_client_config * c) { if (gpr_unref (&c->refs)) { diff --git a/src/core/client_config/client_config.h b/src/core/client_config/client_config.h index 49585a1c62..c6afafe023 100644 --- a/src/core/client_config/client_config.h +++ b/src/core/client_config/client_config.h @@ -42,7 +42,7 @@ typedef struct grpc_client_config grpc_client_config; grpc_client_config *grpc_client_config_create (); void grpc_client_config_ref (grpc_client_config * client_config); -void grpc_client_config_unref (grpc_client_config * client_config, grpc_closure_list * closure_list); +void grpc_client_config_unref (grpc_exec_ctx * exec_ctx, grpc_client_config * client_config); void grpc_client_config_set_lb_policy (grpc_client_config * client_config, grpc_lb_policy * lb_policy); grpc_lb_policy *grpc_client_config_get_lb_policy (grpc_client_config * client_config); diff --git a/src/core/client_config/connector.c b/src/core/client_config/connector.c index 2f50ce36fe..823b82af5c 100644 --- a/src/core/client_config/connector.c +++ b/src/core/client_config/connector.c @@ -40,19 +40,19 @@ grpc_connector_ref (grpc_connector * connector) } void -grpc_connector_unref (grpc_connector * connector, grpc_closure_list * closure_list) +grpc_connector_unref (grpc_exec_ctx * exec_ctx, grpc_connector * connector) { connector->vtable->unref (connector, closure_list); } void -grpc_connector_connect (grpc_connector * connector, const grpc_connect_in_args * in_args, grpc_connect_out_args * out_args, grpc_closure * notify, grpc_closure_list * closure_list) +grpc_connector_connect (grpc_exec_ctx * exec_ctx, grpc_connector * connector, const grpc_connect_in_args * in_args, grpc_connect_out_args * out_args, grpc_closure * notify) { connector->vtable->connect (connector, in_args, out_args, notify, closure_list); } void -grpc_connector_shutdown (grpc_connector * connector, grpc_closure_list * closure_list) +grpc_connector_shutdown (grpc_exec_ctx * exec_ctx, grpc_connector * connector) { connector->vtable->shutdown (connector, closure_list); } diff --git a/src/core/client_config/connector.h b/src/core/client_config/connector.h index 12df36c08e..3abee64008 100644 --- a/src/core/client_config/connector.h +++ b/src/core/client_config/connector.h @@ -71,18 +71,18 @@ typedef struct struct grpc_connector_vtable { void (*ref) (grpc_connector * connector); - void (*unref) (grpc_connector * connector, grpc_closure_list * closure_list); + void (*unref) (grpc_exec_ctx * exec_ctx, grpc_connector * connector); /** Implementation of grpc_connector_shutdown */ - void (*shutdown) (grpc_connector * connector, grpc_closure_list * closure_list); + void (*shutdown) (grpc_exec_ctx * exec_ctx, grpc_connector * connector); /** Implementation of grpc_connector_connect */ - void (*connect) (grpc_connector * connector, const grpc_connect_in_args * in_args, grpc_connect_out_args * out_args, grpc_closure * notify, grpc_closure_list * closure_list); + void (*connect) (grpc_exec_ctx * exec_ctx, grpc_connector * connector, const grpc_connect_in_args * in_args, grpc_connect_out_args * out_args, grpc_closure * notify); }; void grpc_connector_ref (grpc_connector * connector); -void grpc_connector_unref (grpc_connector * connector, grpc_closure_list * closure_list); +void grpc_connector_unref (grpc_exec_ctx * exec_ctx, grpc_connector * connector); /** Connect using the connector: max one outstanding call at a time */ -void grpc_connector_connect (grpc_connector * connector, const grpc_connect_in_args * in_args, grpc_connect_out_args * out_args, grpc_closure * notify, grpc_closure_list * closure_list); +void grpc_connector_connect (grpc_exec_ctx * exec_ctx, grpc_connector * connector, const grpc_connect_in_args * in_args, grpc_connect_out_args * out_args, grpc_closure * notify); /** Cancel any pending connection */ -void grpc_connector_shutdown (grpc_connector * connector, grpc_closure_list * closure_list); +void grpc_connector_shutdown (grpc_exec_ctx * exec_ctx, grpc_connector * connector); #endif diff --git a/src/core/client_config/lb_policies/pick_first.c b/src/core/client_config/lb_policies/pick_first.c index b8991dfaa7..02aaac1dc3 100644 --- a/src/core/client_config/lb_policies/pick_first.c +++ b/src/core/client_config/lb_policies/pick_first.c @@ -79,7 +79,7 @@ typedef struct } pick_first_lb_policy; static void -del_interested_parties_locked (pick_first_lb_policy * p, grpc_closure_list * closure_list) +del_interested_parties_locked (grpc_exec_ctx * exec_ctx, pick_first_lb_policy * p) { pending_pick *pp; for (pp = p->pending_picks; pp; pp = pp->next) @@ -89,7 +89,7 @@ del_interested_parties_locked (pick_first_lb_policy * p, grpc_closure_list * clo } static void -add_interested_parties_locked (pick_first_lb_policy * p, grpc_closure_list * closure_list) +add_interested_parties_locked (grpc_exec_ctx * exec_ctx, pick_first_lb_policy * p) { pending_pick *pp; for (pp = p->pending_picks; pp; pp = pp->next) @@ -99,7 +99,7 @@ add_interested_parties_locked (pick_first_lb_policy * p, grpc_closure_list * clo } void -pf_destroy (grpc_lb_policy * pol, grpc_closure_list * closure_list) +pf_destroy (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol) { pick_first_lb_policy *p = (pick_first_lb_policy *) pol; size_t i; @@ -115,7 +115,7 @@ pf_destroy (grpc_lb_policy * pol, grpc_closure_list * closure_list) } void -pf_shutdown (grpc_lb_policy * pol, grpc_closure_list * closure_list) +pf_shutdown (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol) { pick_first_lb_policy *p = (pick_first_lb_policy *) pol; pending_pick *pp; @@ -137,7 +137,7 @@ pf_shutdown (grpc_lb_policy * pol, grpc_closure_list * closure_list) } static void -start_picking (pick_first_lb_policy * p, grpc_closure_list * closure_list) +start_picking (grpc_exec_ctx * exec_ctx, pick_first_lb_policy * p) { p->started_picking = 1; p->checking_subchannel = 0; @@ -147,7 +147,7 @@ start_picking (pick_first_lb_policy * p, grpc_closure_list * closure_list) } void -pf_exit_idle (grpc_lb_policy * pol, grpc_closure_list * closure_list) +pf_exit_idle (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol) { pick_first_lb_policy *p = (pick_first_lb_policy *) pol; gpr_mu_lock (&p->mu); @@ -159,7 +159,7 @@ pf_exit_idle (grpc_lb_policy * pol, grpc_closure_list * closure_list) } void -pf_pick (grpc_lb_policy * pol, grpc_pollset * pollset, grpc_metadata_batch * initial_metadata, grpc_subchannel ** target, grpc_closure * on_complete, grpc_closure_list * closure_list) +pf_pick (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol, grpc_pollset * pollset, grpc_metadata_batch * initial_metadata, grpc_subchannel ** target, grpc_closure * on_complete) { pick_first_lb_policy *p = (pick_first_lb_policy *) pol; pending_pick *pp; @@ -188,7 +188,7 @@ pf_pick (grpc_lb_policy * pol, grpc_pollset * pollset, grpc_metadata_batch * ini } static void -pf_connectivity_changed (void *arg, int iomgr_success, grpc_closure_list * closure_list) +pf_connectivity_changed (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success) { pick_first_lb_policy *p = arg; pending_pick *pp; @@ -283,7 +283,7 @@ pf_connectivity_changed (void *arg, int iomgr_success, grpc_closure_list * closu } static void -pf_broadcast (grpc_lb_policy * pol, grpc_transport_op * op, grpc_closure_list * closure_list) +pf_broadcast (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol, grpc_transport_op * op) { pick_first_lb_policy *p = (pick_first_lb_policy *) pol; size_t i; @@ -309,7 +309,7 @@ pf_broadcast (grpc_lb_policy * pol, grpc_transport_op * op, grpc_closure_list * } static grpc_connectivity_state -pf_check_connectivity (grpc_lb_policy * pol, grpc_closure_list * closure_list) +pf_check_connectivity (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol) { pick_first_lb_policy *p = (pick_first_lb_policy *) pol; grpc_connectivity_state st; @@ -320,7 +320,7 @@ pf_check_connectivity (grpc_lb_policy * pol, grpc_closure_list * closure_list) } void -pf_notify_on_state_change (grpc_lb_policy * pol, grpc_connectivity_state * current, grpc_closure * notify, grpc_closure_list * closure_list) +pf_notify_on_state_change (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol, grpc_connectivity_state * current, grpc_closure * notify) { pick_first_lb_policy *p = (pick_first_lb_policy *) pol; gpr_mu_lock (&p->mu); diff --git a/src/core/client_config/lb_policies/round_robin.c b/src/core/client_config/lb_policies/round_robin.c index 2e64da9e10..959d9e1c32 100644 --- a/src/core/client_config/lb_policies/round_robin.c +++ b/src/core/client_config/lb_policies/round_robin.c @@ -228,7 +228,7 @@ remove_disconnected_sc_locked (round_robin_lb_policy * p, ready_list * node) } static void -del_interested_parties_locked (round_robin_lb_policy * p, const size_t subchannel_idx, grpc_closure_list * closure_list) +del_interested_parties_locked (grpc_exec_ctx * exec_ctx, round_robin_lb_policy * p, const size_t subchannel_idx) { pending_pick *pp; for (pp = p->pending_picks; pp; pp = pp->next) @@ -238,7 +238,7 @@ del_interested_parties_locked (round_robin_lb_policy * p, const size_t subchanne } void -rr_destroy (grpc_lb_policy * pol, grpc_closure_list * closure_list) +rr_destroy (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol) { round_robin_lb_policy *p = (round_robin_lb_policy *) pol; size_t i; @@ -275,7 +275,7 @@ rr_destroy (grpc_lb_policy * pol, grpc_closure_list * closure_list) } void -rr_shutdown (grpc_lb_policy * pol, grpc_closure_list * closure_list) +rr_shutdown (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol) { size_t i; round_robin_lb_policy *p = (round_robin_lb_policy *) pol; @@ -300,7 +300,7 @@ rr_shutdown (grpc_lb_policy * pol, grpc_closure_list * closure_list) } static void -start_picking (round_robin_lb_policy * p, grpc_closure_list * closure_list) +start_picking (grpc_exec_ctx * exec_ctx, round_robin_lb_policy * p) { size_t i; p->started_picking = 1; @@ -314,7 +314,7 @@ start_picking (round_robin_lb_policy * p, grpc_closure_list * closure_list) } void -rr_exit_idle (grpc_lb_policy * pol, grpc_closure_list * closure_list) +rr_exit_idle (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol) { round_robin_lb_policy *p = (round_robin_lb_policy *) pol; gpr_mu_lock (&p->mu); @@ -326,7 +326,7 @@ rr_exit_idle (grpc_lb_policy * pol, grpc_closure_list * closure_list) } void -rr_pick (grpc_lb_policy * pol, grpc_pollset * pollset, grpc_metadata_batch * initial_metadata, grpc_subchannel ** target, grpc_closure * on_complete, grpc_closure_list * closure_list) +rr_pick (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol, grpc_pollset * pollset, grpc_metadata_batch * initial_metadata, grpc_subchannel ** target, grpc_closure * on_complete) { size_t i; round_robin_lb_policy *p = (round_robin_lb_policy *) pol; @@ -366,7 +366,7 @@ rr_pick (grpc_lb_policy * pol, grpc_pollset * pollset, grpc_metadata_batch * ini } static void -rr_connectivity_changed (void *arg, int iomgr_success, grpc_closure_list * closure_list) +rr_connectivity_changed (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success) { connectivity_changed_cb_arg *cb_arg = arg; round_robin_lb_policy *p = cb_arg->p; @@ -479,7 +479,7 @@ rr_connectivity_changed (void *arg, int iomgr_success, grpc_closure_list * closu } static void -rr_broadcast (grpc_lb_policy * pol, grpc_transport_op * op, grpc_closure_list * closure_list) +rr_broadcast (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol, grpc_transport_op * op) { round_robin_lb_policy *p = (round_robin_lb_policy *) pol; size_t i; @@ -505,7 +505,7 @@ rr_broadcast (grpc_lb_policy * pol, grpc_transport_op * op, grpc_closure_list * } static grpc_connectivity_state -rr_check_connectivity (grpc_lb_policy * pol, grpc_closure_list * closure_list) +rr_check_connectivity (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol) { round_robin_lb_policy *p = (round_robin_lb_policy *) pol; grpc_connectivity_state st; @@ -516,7 +516,7 @@ rr_check_connectivity (grpc_lb_policy * pol, grpc_closure_list * closure_list) } static void -rr_notify_on_state_change (grpc_lb_policy * pol, grpc_connectivity_state * current, grpc_closure * notify, grpc_closure_list * closure_list) +rr_notify_on_state_change (grpc_exec_ctx * exec_ctx, grpc_lb_policy * pol, grpc_connectivity_state * current, grpc_closure * notify) { round_robin_lb_policy *p = (round_robin_lb_policy *) pol; gpr_mu_lock (&p->mu); diff --git a/src/core/client_config/lb_policy.c b/src/core/client_config/lb_policy.c index 40d9079f34..06ac41ff56 100644 --- a/src/core/client_config/lb_policy.c +++ b/src/core/client_config/lb_policy.c @@ -60,7 +60,7 @@ grpc_lb_policy_unref (grpc_lb_policy * policy, grpc_closure_list * closure_list, gpr_log (file, line, GPR_LOG_SEVERITY_DEBUG, "LB_POLICY:%p unref %d -> %d %s", policy, (int) policy->refs.count, (int) policy->refs.count - 1, reason); #else void -grpc_lb_policy_unref (grpc_lb_policy * policy, grpc_closure_list * closure_list) +grpc_lb_policy_unref (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy) { #endif if (gpr_unref (&policy->refs)) @@ -70,37 +70,37 @@ grpc_lb_policy_unref (grpc_lb_policy * policy, grpc_closure_list * closure_list) } void -grpc_lb_policy_shutdown (grpc_lb_policy * policy, grpc_closure_list * closure_list) +grpc_lb_policy_shutdown (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy) { policy->vtable->shutdown (policy, closure_list); } void -grpc_lb_policy_pick (grpc_lb_policy * policy, grpc_pollset * pollset, grpc_metadata_batch * initial_metadata, grpc_subchannel ** target, grpc_closure * on_complete, grpc_closure_list * closure_list) +grpc_lb_policy_pick (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy, grpc_pollset * pollset, grpc_metadata_batch * initial_metadata, grpc_subchannel ** target, grpc_closure * on_complete) { policy->vtable->pick (policy, pollset, initial_metadata, target, on_complete, closure_list); } void -grpc_lb_policy_broadcast (grpc_lb_policy * policy, grpc_transport_op * op, grpc_closure_list * closure_list) +grpc_lb_policy_broadcast (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy, grpc_transport_op * op) { policy->vtable->broadcast (policy, op, closure_list); } void -grpc_lb_policy_exit_idle (grpc_lb_policy * policy, grpc_closure_list * closure_list) +grpc_lb_policy_exit_idle (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy) { policy->vtable->exit_idle (policy, closure_list); } void -grpc_lb_policy_notify_on_state_change (grpc_lb_policy * policy, grpc_connectivity_state * state, grpc_closure * closure, grpc_closure_list * closure_list) +grpc_lb_policy_notify_on_state_change (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy, grpc_connectivity_state * state, grpc_closure * closure) { policy->vtable->notify_on_state_change (policy, state, closure, closure_list); } grpc_connectivity_state -grpc_lb_policy_check_connectivity (grpc_lb_policy * policy, grpc_closure_list * closure_list) +grpc_lb_policy_check_connectivity (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy) { return policy->vtable->check_connectivity (policy, closure_list); } diff --git a/src/core/client_config/lb_policy.h b/src/core/client_config/lb_policy.h index d530e5b7e1..5e6b2a5a6e 100644 --- a/src/core/client_config/lb_policy.h +++ b/src/core/client_config/lb_policy.h @@ -52,25 +52,25 @@ struct grpc_lb_policy struct grpc_lb_policy_vtable { - void (*destroy) (grpc_lb_policy * policy, grpc_closure_list * closure_list); + void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy); - void (*shutdown) (grpc_lb_policy * policy, grpc_closure_list * closure_list); + void (*shutdown) (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy); /** implement grpc_lb_policy_pick */ - void (*pick) (grpc_lb_policy * policy, grpc_pollset * pollset, grpc_metadata_batch * initial_metadata, grpc_subchannel ** target, grpc_closure * on_complete, grpc_closure_list * closure_list); + void (*pick) (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy, grpc_pollset * pollset, grpc_metadata_batch * initial_metadata, grpc_subchannel ** target, grpc_closure * on_complete); /** try to enter a READY connectivity state */ - void (*exit_idle) (grpc_lb_policy * policy, grpc_closure_list * closure_list); + void (*exit_idle) (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy); /** broadcast a transport op to all subchannels */ - void (*broadcast) (grpc_lb_policy * policy, grpc_transport_op * op, grpc_closure_list * closure_list); + void (*broadcast) (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy, grpc_transport_op * op); /** check the current connectivity of the lb_policy */ - grpc_connectivity_state (*check_connectivity) (grpc_lb_policy * policy, grpc_closure_list * closure_list); + grpc_connectivity_state (*check_connectivity) (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy); /** call notify when the connectivity state of a channel changes from *state. Updates *state with the new state of the policy */ - void (*notify_on_state_change) (grpc_lb_policy * policy, grpc_connectivity_state * state, grpc_closure * closure, grpc_closure_list * closure_list); + void (*notify_on_state_change) (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy, grpc_connectivity_state * state, grpc_closure * closure); }; #ifdef GRPC_LB_POLICY_REFCOUNT_DEBUG @@ -84,27 +84,27 @@ void grpc_lb_policy_unref (grpc_lb_policy * policy, grpc_closure_list * closure_ #define GRPC_LB_POLICY_REF(p, r) grpc_lb_policy_ref((p)) #define GRPC_LB_POLICY_UNREF(p, r, cl) grpc_lb_policy_unref((p), (cl)) void grpc_lb_policy_ref (grpc_lb_policy * policy); -void grpc_lb_policy_unref (grpc_lb_policy * policy, grpc_closure_list * closure_list); +void grpc_lb_policy_unref (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy); #endif /** called by concrete implementations to initialize the base struct */ void grpc_lb_policy_init (grpc_lb_policy * policy, const grpc_lb_policy_vtable * vtable); /** Start shutting down (fail any pending picks) */ -void grpc_lb_policy_shutdown (grpc_lb_policy * policy, grpc_closure_list * closure_list); +void grpc_lb_policy_shutdown (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy); /** Given initial metadata in \a initial_metadata, find an appropriate target for this rpc, and 'return' it by calling \a on_complete after setting \a target. Picking can be asynchronous. Any IO should be done under \a pollset. */ -void grpc_lb_policy_pick (grpc_lb_policy * policy, grpc_pollset * pollset, grpc_metadata_batch * initial_metadata, grpc_subchannel ** target, grpc_closure * on_complete, grpc_closure_list * closure_list); +void grpc_lb_policy_pick (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy, grpc_pollset * pollset, grpc_metadata_batch * initial_metadata, grpc_subchannel ** target, grpc_closure * on_complete); -void grpc_lb_policy_broadcast (grpc_lb_policy * policy, grpc_transport_op * op, grpc_closure_list * closure_list); +void grpc_lb_policy_broadcast (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy, grpc_transport_op * op); -void grpc_lb_policy_exit_idle (grpc_lb_policy * policy, grpc_closure_list * closure_list); +void grpc_lb_policy_exit_idle (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy); -void grpc_lb_policy_notify_on_state_change (grpc_lb_policy * policy, grpc_connectivity_state * state, grpc_closure * closure, grpc_closure_list * closure_list); +void grpc_lb_policy_notify_on_state_change (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy, grpc_connectivity_state * state, grpc_closure * closure); -grpc_connectivity_state grpc_lb_policy_check_connectivity (grpc_lb_policy * policy, grpc_closure_list * closure_list); +grpc_connectivity_state grpc_lb_policy_check_connectivity (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy); #endif /* GRPC_INTERNAL_CORE_CONFIG_LB_POLICY_H */ diff --git a/src/core/client_config/resolver.c b/src/core/client_config/resolver.c index 089ce6cd18..cb5a6a5333 100644 --- a/src/core/client_config/resolver.c +++ b/src/core/client_config/resolver.c @@ -60,7 +60,7 @@ grpc_resolver_unref (grpc_resolver * resolver, grpc_closure_list * closure_list, gpr_log (file, line, GPR_LOG_SEVERITY_DEBUG, "RESOLVER:%p unref %d -> %d %s", resolver, (int) resolver->refs.count, (int) resolver->refs.count - 1, reason); #else void -grpc_resolver_unref (grpc_resolver * resolver, grpc_closure_list * closure_list) +grpc_resolver_unref (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver) { #endif if (gpr_unref (&resolver->refs)) @@ -70,19 +70,19 @@ grpc_resolver_unref (grpc_resolver * resolver, grpc_closure_list * closure_list) } void -grpc_resolver_shutdown (grpc_resolver * resolver, grpc_closure_list * closure_list) +grpc_resolver_shutdown (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver) { resolver->vtable->shutdown (resolver, closure_list); } void -grpc_resolver_channel_saw_error (grpc_resolver * resolver, struct sockaddr *failing_address, int failing_address_len, grpc_closure_list * closure_list) +grpc_resolver_channel_saw_error (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver, struct sockaddr *failing_address, int failing_address_len) { resolver->vtable->channel_saw_error (resolver, failing_address, failing_address_len, closure_list); } void -grpc_resolver_next (grpc_resolver * resolver, grpc_client_config ** target_config, grpc_closure * on_complete, grpc_closure_list * closure_list) +grpc_resolver_next (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver, grpc_client_config ** target_config, grpc_closure * on_complete) { resolver->vtable->next (resolver, target_config, on_complete, closure_list); } diff --git a/src/core/client_config/resolver.h b/src/core/client_config/resolver.h index b51ef89bd5..2497873c01 100644 --- a/src/core/client_config/resolver.h +++ b/src/core/client_config/resolver.h @@ -51,10 +51,10 @@ struct grpc_resolver struct grpc_resolver_vtable { - void (*destroy) (grpc_resolver * resolver, grpc_closure_list * closure_list); - void (*shutdown) (grpc_resolver * resolver, grpc_closure_list * closure_list); - void (*channel_saw_error) (grpc_resolver * resolver, struct sockaddr * failing_address, int failing_address_len, grpc_closure_list * closure_list); - void (*next) (grpc_resolver * resolver, grpc_client_config ** target_config, grpc_closure * on_complete, grpc_closure_list * closure_list); + void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver); + void (*shutdown) (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver); + void (*channel_saw_error) (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver, struct sockaddr * failing_address, int failing_address_len); + void (*next) (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver, grpc_client_config ** target_config, grpc_closure * on_complete); }; #ifdef GRPC_RESOLVER_REFCOUNT_DEBUG @@ -67,16 +67,16 @@ void grpc_resolver_unref (grpc_resolver * policy, grpc_closure_list * closure_li #define GRPC_RESOLVER_REF(p, r) grpc_resolver_ref((p)) #define GRPC_RESOLVER_UNREF(p, r, cl) grpc_resolver_unref((p), (cl)) void grpc_resolver_ref (grpc_resolver * policy); -void grpc_resolver_unref (grpc_resolver * policy, grpc_closure_list * closure_list); +void grpc_resolver_unref (grpc_exec_ctx * exec_ctx, grpc_resolver * policy); #endif void grpc_resolver_init (grpc_resolver * resolver, const grpc_resolver_vtable * vtable); -void grpc_resolver_shutdown (grpc_resolver * resolver, grpc_closure_list * closure_list); +void grpc_resolver_shutdown (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver); /** Notification that the channel has seen an error on some address. Can be used as a hint that re-resolution is desirable soon. */ -void grpc_resolver_channel_saw_error (grpc_resolver * resolver, struct sockaddr *failing_address, int failing_address_len, grpc_closure_list * closure_list); +void grpc_resolver_channel_saw_error (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver, struct sockaddr *failing_address, int failing_address_len); /** Get the next client config. Called by the channel to fetch a new configuration. Expected to set *target_config with a new configuration, @@ -84,6 +84,6 @@ void grpc_resolver_channel_saw_error (grpc_resolver * resolver, struct sockaddr If resolution is fatally broken, set *target_config to NULL and schedule on_complete. */ -void grpc_resolver_next (grpc_resolver * resolver, grpc_client_config ** target_config, grpc_closure * on_complete, grpc_closure_list * closure_list); +void grpc_resolver_next (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver, grpc_client_config ** target_config, grpc_closure * on_complete); #endif /* GRPC_INTERNAL_CORE_CONFIG_RESOLVER_H */ diff --git a/src/core/client_config/resolvers/dns_resolver.c b/src/core/client_config/resolvers/dns_resolver.c index 10d6cfa13e..66430c43cb 100644 --- a/src/core/client_config/resolvers/dns_resolver.c +++ b/src/core/client_config/resolvers/dns_resolver.c @@ -75,21 +75,21 @@ typedef struct grpc_client_config *resolved_config; } dns_resolver; -static void dns_destroy (grpc_resolver * r, grpc_closure_list * closure_list); +static void dns_destroy (grpc_exec_ctx * exec_ctx, grpc_resolver * r); static void dns_start_resolving_locked (dns_resolver * r); -static void dns_maybe_finish_next_locked (dns_resolver * r, grpc_closure_list * closure_list); +static void dns_maybe_finish_next_locked (grpc_exec_ctx * exec_ctx, dns_resolver * r); -static void dns_shutdown (grpc_resolver * r, grpc_closure_list * closure_list); -static void dns_channel_saw_error (grpc_resolver * r, struct sockaddr *failing_address, int failing_address_len, grpc_closure_list * closure_list); -static void dns_next (grpc_resolver * r, grpc_client_config ** target_config, grpc_closure * on_complete, grpc_closure_list * closure_list); +static void dns_shutdown (grpc_exec_ctx * exec_ctx, grpc_resolver * r); +static void dns_channel_saw_error (grpc_exec_ctx * exec_ctx, grpc_resolver * r, struct sockaddr *failing_address, int failing_address_len); +static void dns_next (grpc_exec_ctx * exec_ctx, grpc_resolver * r, grpc_client_config ** target_config, grpc_closure * on_complete); static const grpc_resolver_vtable dns_resolver_vtable = { dns_destroy, dns_shutdown, dns_channel_saw_error, dns_next }; static void -dns_shutdown (grpc_resolver * resolver, grpc_closure_list * closure_list) +dns_shutdown (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver) { dns_resolver *r = (dns_resolver *) resolver; gpr_mu_lock (&r->mu); @@ -103,7 +103,7 @@ dns_shutdown (grpc_resolver * resolver, grpc_closure_list * closure_list) } static void -dns_channel_saw_error (grpc_resolver * resolver, struct sockaddr *sa, int len, grpc_closure_list * closure_list) +dns_channel_saw_error (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver, struct sockaddr *sa, int len) { dns_resolver *r = (dns_resolver *) resolver; gpr_mu_lock (&r->mu); @@ -115,7 +115,7 @@ dns_channel_saw_error (grpc_resolver * resolver, struct sockaddr *sa, int len, g } static void -dns_next (grpc_resolver * resolver, grpc_client_config ** target_config, grpc_closure * on_complete, grpc_closure_list * closure_list) +dns_next (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver, grpc_client_config ** target_config, grpc_closure * on_complete) { dns_resolver *r = (dns_resolver *) resolver; gpr_mu_lock (&r->mu); @@ -134,7 +134,7 @@ dns_next (grpc_resolver * resolver, grpc_client_config ** target_config, grpc_cl } static void -dns_on_resolved (void *arg, grpc_resolved_addresses * addresses, grpc_closure_list * closure_list) +dns_on_resolved (grpc_exec_ctx * exec_ctx, void *arg, grpc_resolved_addresses * addresses) { dns_resolver *r = arg; grpc_client_config *config = NULL; @@ -188,7 +188,7 @@ dns_start_resolving_locked (dns_resolver * r) } static void -dns_maybe_finish_next_locked (dns_resolver * r, grpc_closure_list * closure_list) +dns_maybe_finish_next_locked (grpc_exec_ctx * exec_ctx, dns_resolver * r) { if (r->next_completion != NULL && r->resolved_version != r->published_version) { @@ -204,7 +204,7 @@ dns_maybe_finish_next_locked (dns_resolver * r, grpc_closure_list * closure_list } static void -dns_destroy (grpc_resolver * gr, grpc_closure_list * closure_list) +dns_destroy (grpc_exec_ctx * exec_ctx, grpc_resolver * gr) { dns_resolver *r = (dns_resolver *) gr; gpr_mu_destroy (&r->mu); diff --git a/src/core/client_config/resolvers/sockaddr_resolver.c b/src/core/client_config/resolvers/sockaddr_resolver.c index 5358caf3bd..2887cffcd4 100644 --- a/src/core/client_config/resolvers/sockaddr_resolver.c +++ b/src/core/client_config/resolvers/sockaddr_resolver.c @@ -77,13 +77,13 @@ typedef struct grpc_client_config **target_config; } sockaddr_resolver; -static void sockaddr_destroy (grpc_resolver * r, grpc_closure_list * closure_list); +static void sockaddr_destroy (grpc_exec_ctx * exec_ctx, grpc_resolver * r); -static void sockaddr_maybe_finish_next_locked (sockaddr_resolver * r, grpc_closure_list * closure_list); +static void sockaddr_maybe_finish_next_locked (grpc_exec_ctx * exec_ctx, sockaddr_resolver * r); -static void sockaddr_shutdown (grpc_resolver * r, grpc_closure_list * closure_list); -static void sockaddr_channel_saw_error (grpc_resolver * r, struct sockaddr *failing_address, int failing_address_len, grpc_closure_list * closure_list); -static void sockaddr_next (grpc_resolver * r, grpc_client_config ** target_config, grpc_closure * on_complete, grpc_closure_list * closure_list); +static void sockaddr_shutdown (grpc_exec_ctx * exec_ctx, grpc_resolver * r); +static void sockaddr_channel_saw_error (grpc_exec_ctx * exec_ctx, grpc_resolver * r, struct sockaddr *failing_address, int failing_address_len); +static void sockaddr_next (grpc_exec_ctx * exec_ctx, grpc_resolver * r, grpc_client_config ** target_config, grpc_closure * on_complete); static const grpc_resolver_vtable sockaddr_resolver_vtable = { sockaddr_destroy, sockaddr_shutdown, sockaddr_channel_saw_error, @@ -91,7 +91,7 @@ static const grpc_resolver_vtable sockaddr_resolver_vtable = { }; static void -sockaddr_shutdown (grpc_resolver * resolver, grpc_closure_list * closure_list) +sockaddr_shutdown (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver) { sockaddr_resolver *r = (sockaddr_resolver *) resolver; gpr_mu_lock (&r->mu); @@ -105,12 +105,12 @@ sockaddr_shutdown (grpc_resolver * resolver, grpc_closure_list * closure_list) } static void -sockaddr_channel_saw_error (grpc_resolver * resolver, struct sockaddr *sa, int len, grpc_closure_list * closure_list) +sockaddr_channel_saw_error (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver, struct sockaddr *sa, int len) { } static void -sockaddr_next (grpc_resolver * resolver, grpc_client_config ** target_config, grpc_closure * on_complete, grpc_closure_list * closure_list) +sockaddr_next (grpc_exec_ctx * exec_ctx, grpc_resolver * resolver, grpc_client_config ** target_config, grpc_closure * on_complete) { sockaddr_resolver *r = (sockaddr_resolver *) resolver; gpr_mu_lock (&r->mu); @@ -122,7 +122,7 @@ sockaddr_next (grpc_resolver * resolver, grpc_client_config ** target_config, gr } static void -sockaddr_maybe_finish_next_locked (sockaddr_resolver * r, grpc_closure_list * closure_list) +sockaddr_maybe_finish_next_locked (grpc_exec_ctx * exec_ctx, sockaddr_resolver * r) { grpc_client_config *cfg; grpc_lb_policy *lb_policy; @@ -157,7 +157,7 @@ sockaddr_maybe_finish_next_locked (sockaddr_resolver * r, grpc_closure_list * cl } static void -sockaddr_destroy (grpc_resolver * gr, grpc_closure_list * closure_list) +sockaddr_destroy (grpc_exec_ctx * exec_ctx, grpc_resolver * gr) { sockaddr_resolver *r = (sockaddr_resolver *) gr; gpr_mu_destroy (&r->mu); diff --git a/src/core/client_config/subchannel.c b/src/core/client_config/subchannel.c index 778d1e8b50..1ab348da83 100644 --- a/src/core/client_config/subchannel.c +++ b/src/core/client_config/subchannel.c @@ -148,11 +148,11 @@ struct grpc_subchannel_call #define SUBCHANNEL_CALL_TO_CALL_STACK(call) ((grpc_call_stack *)((call) + 1)) #define CHANNEL_STACK_FROM_CONNECTION(con) ((grpc_channel_stack *)((con) + 1)) -static grpc_subchannel_call *create_call (connection * con, grpc_closure_list * closure_list); -static void connectivity_state_changed_locked (grpc_subchannel * c, const char *reason, grpc_closure_list * closure_list); +static grpc_subchannel_call *create_call (grpc_exec_ctx * exec_ctx, connection * con); +static void connectivity_state_changed_locked (grpc_exec_ctx * exec_ctx, grpc_subchannel * c, const char *reason); static grpc_connectivity_state compute_connectivity_locked (grpc_subchannel * c); static gpr_timespec compute_connect_deadline (grpc_subchannel * c); -static void subchannel_connected (void *subchannel, int iomgr_success, grpc_closure_list * closure_list); +static void subchannel_connected (grpc_exec_ctx * exec_ctx, void *subchannel, int iomgr_success); static void subchannel_ref_locked (grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS); static int @@ -160,7 +160,7 @@ subchannel_unref_locked (grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) GRPC_MUST_USE_RESULT; static void connection_ref_locked (connection * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS); static grpc_subchannel *connection_unref_locked (connection * c, grpc_closure_list * closure_list GRPC_SUBCHANNEL_REF_EXTRA_ARGS) GRPC_MUST_USE_RESULT; - static void subchannel_destroy (grpc_subchannel * c, grpc_closure_list * closure_list); + static void subchannel_destroy (grpc_exec_ctx * exec_ctx, grpc_subchannel * c); #ifdef GRPC_SUBCHANNEL_REFCOUNT_DEBUG #define SUBCHANNEL_REF_LOCKED(p, r) \ @@ -196,7 +196,7 @@ subchannel_unref_locked (grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) * connection implementation */ - static void connection_destroy (connection * c, grpc_closure_list * closure_list) + static void connection_destroy (grpc_exec_ctx * exec_ctx, connection * c) { GPR_ASSERT (c->refs == 0); grpc_channel_stack_destroy (CHANNEL_STACK_FROM_CONNECTION (c), closure_list); @@ -265,7 +265,7 @@ grpc_subchannel_unref (grpc_subchannel * c, grpc_closure_list * closure_list GRP } static void -subchannel_destroy (grpc_subchannel * c, grpc_closure_list * closure_list) +subchannel_destroy (grpc_exec_ctx * exec_ctx, grpc_subchannel * c) { if (c->active != NULL) { @@ -281,13 +281,13 @@ subchannel_destroy (grpc_subchannel * c, grpc_closure_list * closure_list) } void -grpc_subchannel_add_interested_party (grpc_subchannel * c, grpc_pollset * pollset, grpc_closure_list * closure_list) +grpc_subchannel_add_interested_party (grpc_exec_ctx * exec_ctx, grpc_subchannel * c, grpc_pollset * pollset) { grpc_pollset_set_add_pollset (c->pollset_set, pollset, closure_list); } void -grpc_subchannel_del_interested_party (grpc_subchannel * c, grpc_pollset * pollset, grpc_closure_list * closure_list) +grpc_subchannel_del_interested_party (grpc_exec_ctx * exec_ctx, grpc_subchannel * c, grpc_pollset * pollset) { grpc_pollset_set_del_pollset (c->pollset_set, pollset, closure_list); } @@ -326,7 +326,7 @@ grpc_subchannel_create (grpc_connector * connector, grpc_subchannel_args * args) } static void -continue_connect (grpc_subchannel * c, grpc_closure_list * closure_list) +continue_connect (grpc_exec_ctx * exec_ctx, grpc_subchannel * c) { grpc_connect_in_args args; @@ -340,7 +340,7 @@ continue_connect (grpc_subchannel * c, grpc_closure_list * closure_list) } static void -start_connect (grpc_subchannel * c, grpc_closure_list * closure_list) +start_connect (grpc_exec_ctx * exec_ctx, grpc_subchannel * c) { c->backoff_delta = gpr_time_from_seconds (GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS, GPR_TIMESPAN); c->next_attempt = gpr_time_add (gpr_now (GPR_CLOCK_MONOTONIC), c->backoff_delta); @@ -348,7 +348,7 @@ start_connect (grpc_subchannel * c, grpc_closure_list * closure_list) } static void -continue_creating_call (void *arg, int iomgr_success, grpc_closure_list * closure_list) +continue_creating_call (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success) { waiting_for_connect *w4c = arg; grpc_subchannel_del_interested_party (w4c->subchannel, w4c->pollset, closure_list); @@ -358,7 +358,7 @@ continue_creating_call (void *arg, int iomgr_success, grpc_closure_list * closur } void -grpc_subchannel_create_call (grpc_subchannel * c, grpc_pollset * pollset, grpc_subchannel_call ** target, grpc_closure * notify, grpc_closure_list * closure_list) +grpc_subchannel_create_call (grpc_exec_ctx * exec_ctx, grpc_subchannel * c, grpc_pollset * pollset, grpc_subchannel_call ** target, grpc_closure * notify) { connection *con; gpr_mu_lock (&c->mu); @@ -413,7 +413,7 @@ grpc_subchannel_check_connectivity (grpc_subchannel * c) } void -grpc_subchannel_notify_on_state_change (grpc_subchannel * c, grpc_connectivity_state * state, grpc_closure * notify, grpc_closure_list * closure_list) +grpc_subchannel_notify_on_state_change (grpc_exec_ctx * exec_ctx, grpc_subchannel * c, grpc_connectivity_state * state, grpc_closure * notify) { int do_connect = 0; gpr_mu_lock (&c->mu); @@ -435,7 +435,7 @@ grpc_subchannel_notify_on_state_change (grpc_subchannel * c, grpc_connectivity_s } void -grpc_subchannel_process_transport_op (grpc_subchannel * c, grpc_transport_op * op, grpc_closure_list * closure_list) +grpc_subchannel_process_transport_op (grpc_exec_ctx * exec_ctx, grpc_subchannel * c, grpc_transport_op * op) { connection *con = NULL; grpc_subchannel *destroy; @@ -484,7 +484,7 @@ grpc_subchannel_process_transport_op (grpc_subchannel * c, grpc_transport_op * o } static void -on_state_changed (void *p, int iomgr_success, grpc_closure_list * closure_list) +on_state_changed (grpc_exec_ctx * exec_ctx, void *p, int iomgr_success) { state_watcher *sw = p; grpc_subchannel *c = sw->subchannel; @@ -545,7 +545,7 @@ done: } static void -publish_transport (grpc_subchannel * c, grpc_closure_list * closure_list) +publish_transport (grpc_exec_ctx * exec_ctx, grpc_subchannel * c) { size_t channel_stack_size; connection *con; @@ -668,7 +668,7 @@ update_reconnect_parameters (grpc_subchannel * c) } static void -on_alarm (void *arg, int iomgr_success, grpc_closure_list * closure_list) +on_alarm (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success) { grpc_subchannel *c = arg; gpr_mu_lock (&c->mu); @@ -692,7 +692,7 @@ on_alarm (void *arg, int iomgr_success, grpc_closure_list * closure_list) } static void -subchannel_connected (void *arg, int iomgr_success, grpc_closure_list * closure_list) +subchannel_connected (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success) { grpc_subchannel *c = arg; if (c->connecting_result.transport != NULL) @@ -744,7 +744,7 @@ compute_connectivity_locked (grpc_subchannel * c) } static void -connectivity_state_changed_locked (grpc_subchannel * c, const char *reason, grpc_closure_list * closure_list) +connectivity_state_changed_locked (grpc_exec_ctx * exec_ctx, grpc_subchannel * c, const char *reason) { grpc_connectivity_state current = compute_connectivity_locked (c); grpc_connectivity_state_set (&c->state_tracker, current, reason, closure_list); @@ -780,7 +780,7 @@ grpc_subchannel_call_unref (grpc_subchannel_call * c, grpc_closure_list * closur } char * -grpc_subchannel_call_get_peer (grpc_subchannel_call * call, grpc_closure_list * closure_list) +grpc_subchannel_call_get_peer (grpc_exec_ctx * exec_ctx, grpc_subchannel_call * call) { grpc_call_stack *call_stack = SUBCHANNEL_CALL_TO_CALL_STACK (call); grpc_call_element *top_elem = grpc_call_stack_element (call_stack, 0); @@ -788,7 +788,7 @@ grpc_subchannel_call_get_peer (grpc_subchannel_call * call, grpc_closure_list * } void -grpc_subchannel_call_process_op (grpc_subchannel_call * call, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +grpc_subchannel_call_process_op (grpc_exec_ctx * exec_ctx, grpc_subchannel_call * call, grpc_transport_stream_op * op) { grpc_call_stack *call_stack = SUBCHANNEL_CALL_TO_CALL_STACK (call); grpc_call_element *top_elem = grpc_call_stack_element (call_stack, 0); @@ -796,7 +796,7 @@ grpc_subchannel_call_process_op (grpc_subchannel_call * call, grpc_transport_str } static grpc_subchannel_call * -create_call (connection * con, grpc_closure_list * closure_list) +create_call (grpc_exec_ctx * exec_ctx, connection * con) { grpc_channel_stack *chanstk = CHANNEL_STACK_FROM_CONNECTION (con); grpc_subchannel_call *call = gpr_malloc (sizeof (grpc_subchannel_call) + chanstk->call_stack_size); diff --git a/src/core/client_config/subchannel.h b/src/core/client_config/subchannel.h index 69cf07f626..2d6328db86 100644 --- a/src/core/client_config/subchannel.h +++ b/src/core/client_config/subchannel.h @@ -70,28 +70,28 @@ void grpc_subchannel_call_ref (grpc_subchannel_call * call GRPC_SUBCHANNEL_REF_E void grpc_subchannel_call_unref (grpc_subchannel_call * call, grpc_closure_list * closure_list GRPC_SUBCHANNEL_REF_EXTRA_ARGS); /** construct a call (possibly asynchronously) */ -void grpc_subchannel_create_call (grpc_subchannel * subchannel, grpc_pollset * pollset, grpc_subchannel_call ** target, grpc_closure * notify, grpc_closure_list * closure_list); +void grpc_subchannel_create_call (grpc_exec_ctx * exec_ctx, grpc_subchannel * subchannel, grpc_pollset * pollset, grpc_subchannel_call ** target, grpc_closure * notify); /** process a transport level op */ -void grpc_subchannel_process_transport_op (grpc_subchannel * subchannel, grpc_transport_op * op, grpc_closure_list * closure_list); +void grpc_subchannel_process_transport_op (grpc_exec_ctx * exec_ctx, grpc_subchannel * subchannel, grpc_transport_op * op); /** poll the current connectivity state of a channel */ grpc_connectivity_state grpc_subchannel_check_connectivity (grpc_subchannel * channel); /** call notify when the connectivity state of a channel changes from *state. Updates *state with the new state of the channel */ -void grpc_subchannel_notify_on_state_change (grpc_subchannel * channel, grpc_connectivity_state * state, grpc_closure * notify, grpc_closure_list * closure_list); +void grpc_subchannel_notify_on_state_change (grpc_exec_ctx * exec_ctx, grpc_subchannel * channel, grpc_connectivity_state * state, grpc_closure * notify); /** express interest in \a channel's activities through \a pollset. */ -void grpc_subchannel_add_interested_party (grpc_subchannel * channel, grpc_pollset * pollset, grpc_closure_list * closure_list); +void grpc_subchannel_add_interested_party (grpc_exec_ctx * exec_ctx, grpc_subchannel * channel, grpc_pollset * pollset); /** stop following \a channel's activity through \a pollset. */ -void grpc_subchannel_del_interested_party (grpc_subchannel * channel, grpc_pollset * pollset, grpc_closure_list * closure_list); +void grpc_subchannel_del_interested_party (grpc_exec_ctx * exec_ctx, grpc_subchannel * channel, grpc_pollset * pollset); /** continue processing a transport op */ -void grpc_subchannel_call_process_op (grpc_subchannel_call * subchannel_call, grpc_transport_stream_op * op, grpc_closure_list * closure_list); +void grpc_subchannel_call_process_op (grpc_exec_ctx * exec_ctx, grpc_subchannel_call * subchannel_call, grpc_transport_stream_op * op); /** continue querying for peer */ -char *grpc_subchannel_call_get_peer (grpc_subchannel_call * subchannel_call, grpc_closure_list * closure_list); +char *grpc_subchannel_call_get_peer (grpc_exec_ctx * exec_ctx, grpc_subchannel_call * subchannel_call); struct grpc_subchannel_args { diff --git a/src/core/client_config/subchannel_factory.c b/src/core/client_config/subchannel_factory.c index 29e854e2ed..82b851c2f7 100644 --- a/src/core/client_config/subchannel_factory.c +++ b/src/core/client_config/subchannel_factory.c @@ -40,13 +40,13 @@ grpc_subchannel_factory_ref (grpc_subchannel_factory * factory) } void -grpc_subchannel_factory_unref (grpc_subchannel_factory * factory, grpc_closure_list * closure_list) +grpc_subchannel_factory_unref (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * factory) { factory->vtable->unref (factory, closure_list); } grpc_subchannel * -grpc_subchannel_factory_create_subchannel (grpc_subchannel_factory * factory, grpc_subchannel_args * args, grpc_closure_list * closure_list) +grpc_subchannel_factory_create_subchannel (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * factory, grpc_subchannel_args * args) { return factory->vtable->create_subchannel (factory, args, closure_list); } diff --git a/src/core/client_config/subchannel_factory.h b/src/core/client_config/subchannel_factory.h index 771638e0fb..7586a74754 100644 --- a/src/core/client_config/subchannel_factory.h +++ b/src/core/client_config/subchannel_factory.h @@ -50,14 +50,14 @@ struct grpc_subchannel_factory struct grpc_subchannel_factory_vtable { void (*ref) (grpc_subchannel_factory * factory); - void (*unref) (grpc_subchannel_factory * factory, grpc_closure_list * closure_list); - grpc_subchannel *(*create_subchannel) (grpc_subchannel_factory * factory, grpc_subchannel_args * args, grpc_closure_list * closure_list); + void (*unref) (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * factory); + grpc_subchannel *(*create_subchannel) (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * factory, grpc_subchannel_args * args); }; void grpc_subchannel_factory_ref (grpc_subchannel_factory * factory); -void grpc_subchannel_factory_unref (grpc_subchannel_factory * factory, grpc_closure_list * closure_list); +void grpc_subchannel_factory_unref (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * factory); /** Create a new grpc_subchannel */ -grpc_subchannel *grpc_subchannel_factory_create_subchannel (grpc_subchannel_factory * factory, grpc_subchannel_args * args, grpc_closure_list * closure_list); +grpc_subchannel *grpc_subchannel_factory_create_subchannel (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * factory, grpc_subchannel_args * args); #endif /* GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_H */ diff --git a/src/core/client_config/subchannel_factory_decorators/merge_channel_args.c b/src/core/client_config/subchannel_factory_decorators/merge_channel_args.c index 993b95296b..59af175da1 100644 --- a/src/core/client_config/subchannel_factory_decorators/merge_channel_args.c +++ b/src/core/client_config/subchannel_factory_decorators/merge_channel_args.c @@ -51,7 +51,7 @@ merge_args_factory_ref (grpc_subchannel_factory * scf) } static void -merge_args_factory_unref (grpc_subchannel_factory * scf, grpc_closure_list * closure_list) +merge_args_factory_unref (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * scf) { merge_args_factory *f = (merge_args_factory *) scf; if (gpr_unref (&f->refs)) @@ -63,7 +63,7 @@ merge_args_factory_unref (grpc_subchannel_factory * scf, grpc_closure_list * clo } static grpc_subchannel * -merge_args_factory_create_subchannel (grpc_subchannel_factory * scf, grpc_subchannel_args * args, grpc_closure_list * closure_list) +merge_args_factory_create_subchannel (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * scf, grpc_subchannel_args * args) { merge_args_factory *f = (merge_args_factory *) scf; grpc_channel_args *final_args = grpc_channel_args_merge (args->args, f->merge_args); diff --git a/src/core/httpcli/httpcli.c b/src/core/httpcli/httpcli.c index 1196f237a0..fac80a44a1 100644 --- a/src/core/httpcli/httpcli.c +++ b/src/core/httpcli/httpcli.c @@ -73,7 +73,7 @@ static grpc_httpcli_get_override g_get_override = NULL; static grpc_httpcli_post_override g_post_override = NULL; static void -plaintext_handshake (void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list), grpc_closure_list * closure_list) +plaintext_handshake (void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list)) { on_done (arg, endpoint, closure_list); } @@ -94,10 +94,10 @@ grpc_httpcli_context_destroy (grpc_httpcli_context * context) grpc_pollset_set_destroy (&context->pollset_set); } -static void next_address (internal_request * req, grpc_closure_list * closure_list); +static void next_address (grpc_exec_ctx * exec_ctx, internal_request * req); static void -finish (internal_request * req, int success, grpc_closure_list * closure_list) +finish (grpc_exec_ctx * exec_ctx, internal_request * req, int success) { grpc_pollset_set_del_pollset (&req->context->pollset_set, req->pollset, closure_list); req->on_response (req->user_data, success ? &req->parser.r : NULL, closure_list); @@ -118,16 +118,16 @@ finish (internal_request * req, int success, grpc_closure_list * closure_list) gpr_free (req); } -static void on_read (void *user_data, int success, grpc_closure_list * closure_list); +static void on_read (grpc_exec_ctx * exec_ctx, void *user_data, int success); static void -do_read (internal_request * req, grpc_closure_list * closure_list) +do_read (grpc_exec_ctx * exec_ctx, internal_request * req) { grpc_endpoint_read (req->ep, &req->incoming, &req->on_read, closure_list); } static void -on_read (void *user_data, int success, grpc_closure_list * closure_list) +on_read (grpc_exec_ctx * exec_ctx, void *user_data, int success) { internal_request *req = user_data; size_t i; @@ -160,13 +160,13 @@ on_read (void *user_data, int success, grpc_closure_list * closure_list) } static void -on_written (internal_request * req, grpc_closure_list * closure_list) +on_written (grpc_exec_ctx * exec_ctx, internal_request * req) { do_read (req, closure_list); } static void -done_write (void *arg, int success, grpc_closure_list * closure_list) +done_write (grpc_exec_ctx * exec_ctx, void *arg, int success) { internal_request *req = arg; if (success) @@ -180,7 +180,7 @@ done_write (void *arg, int success, grpc_closure_list * closure_list) } static void -start_write (internal_request * req, grpc_closure_list * closure_list) +start_write (grpc_exec_ctx * exec_ctx, internal_request * req) { gpr_slice_ref (req->request_text); gpr_slice_buffer_add (&req->outgoing, req->request_text); @@ -188,7 +188,7 @@ start_write (internal_request * req, grpc_closure_list * closure_list) } static void -on_handshake_done (void *arg, grpc_endpoint * ep, grpc_closure_list * closure_list) +on_handshake_done (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * ep) { internal_request *req = arg; @@ -203,7 +203,7 @@ on_handshake_done (void *arg, grpc_endpoint * ep, grpc_closure_list * closure_li } static void -on_connected (void *arg, int success, grpc_closure_list * closure_list) +on_connected (grpc_exec_ctx * exec_ctx, void *arg, int success) { internal_request *req = arg; @@ -216,7 +216,7 @@ on_connected (void *arg, int success, grpc_closure_list * closure_list) } static void -next_address (internal_request * req, grpc_closure_list * closure_list) +next_address (grpc_exec_ctx * exec_ctx, internal_request * req) { grpc_resolved_address *addr; if (req->next_address == req->addresses->naddrs) @@ -230,7 +230,7 @@ next_address (internal_request * req, grpc_closure_list * closure_list) } static void -on_resolved (void *arg, grpc_resolved_addresses * addresses, grpc_closure_list * closure_list) +on_resolved (grpc_exec_ctx * exec_ctx, void *arg, grpc_resolved_addresses * addresses) { internal_request *req = arg; if (!addresses) @@ -244,7 +244,7 @@ on_resolved (void *arg, grpc_resolved_addresses * addresses, grpc_closure_list * } static void -internal_request_begin (grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data, const char *name, gpr_slice request_text, grpc_closure_list * closure_list) +internal_request_begin (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data, const char *name, gpr_slice request_text) { internal_request *req = gpr_malloc (sizeof (internal_request)); memset (req, 0, sizeof (*req)); @@ -268,7 +268,7 @@ internal_request_begin (grpc_httpcli_context * context, grpc_pollset * pollset, } void -grpc_httpcli_get (grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data, grpc_closure_list * closure_list) +grpc_httpcli_get (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data) { char *name; if (g_get_override && g_get_override (request, deadline, on_response, user_data, closure_list)) @@ -281,7 +281,7 @@ grpc_httpcli_get (grpc_httpcli_context * context, grpc_pollset * pollset, const } void -grpc_httpcli_post (grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, const char *body_bytes, size_t body_size, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data, grpc_closure_list * closure_list) +grpc_httpcli_post (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, const char *body_bytes, size_t body_size, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data) { char *name; if (g_post_override && g_post_override (request, body_bytes, body_size, deadline, on_response, user_data, closure_list)) diff --git a/src/core/httpcli/httpcli.h b/src/core/httpcli/httpcli.h index cfe7e4b2af..021d619900 100644 --- a/src/core/httpcli/httpcli.h +++ b/src/core/httpcli/httpcli.h @@ -64,7 +64,7 @@ typedef struct grpc_httpcli_context typedef struct { const char *default_port; - void (*handshake) (void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list), grpc_closure_list * closure_list); + void (*handshake) (void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list)); } grpc_httpcli_handshaker; extern const grpc_httpcli_handshaker grpc_httpcli_plaintext; @@ -100,7 +100,7 @@ typedef struct grpc_httpcli_response } grpc_httpcli_response; /* Callback for grpc_httpcli_get and grpc_httpcli_post. */ -typedef void (*grpc_httpcli_response_cb) (void *user_data, const grpc_httpcli_response * response, grpc_closure_list * closure_list); +typedef void (*grpc_httpcli_response_cb) (grpc_exec_ctx * exec_ctx, void *user_data, const grpc_httpcli_response * response); void grpc_httpcli_context_init (grpc_httpcli_context * context); void grpc_httpcli_context_destroy (grpc_httpcli_context * context); @@ -115,7 +115,7 @@ void grpc_httpcli_context_destroy (grpc_httpcli_context * context); 'deadline' contains a deadline for the request (or gpr_inf_future) 'on_response' is a callback to report results to (and 'user_data' is a user supplied pointer to pass to said call) */ -void grpc_httpcli_get (grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data, grpc_closure_list * closure_list); +void grpc_httpcli_get (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data); /* Asynchronously perform a HTTP POST. 'context' specifies the http context under which to do the post @@ -132,11 +132,11 @@ void grpc_httpcli_get (grpc_httpcli_context * context, grpc_pollset * pollset, c 'on_response' is a callback to report results to (and 'user_data' is a user supplied pointer to pass to said call) Does not support ?var1=val1&var2=val2 in the path. */ -void grpc_httpcli_post (grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, const char *body_bytes, size_t body_size, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data, grpc_closure_list * closure_list); +void grpc_httpcli_post (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc_pollset * pollset, const grpc_httpcli_request * request, const char *body_bytes, size_t body_size, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data); /* override functions return 1 if they handled the request, 0 otherwise */ -typedef int (*grpc_httpcli_get_override) (const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data, grpc_closure_list * closure_list); -typedef int (*grpc_httpcli_post_override) (const grpc_httpcli_request * request, const char *body_bytes, size_t body_size, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data, grpc_closure_list * closure_list); +typedef int (*grpc_httpcli_get_override) (grpc_exec_ctx * exec_ctx, const grpc_httpcli_request * request, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data); +typedef int (*grpc_httpcli_post_override) (grpc_exec_ctx * exec_ctx, const grpc_httpcli_request * request, const char *body_bytes, size_t body_size, gpr_timespec deadline, grpc_httpcli_response_cb on_response, void *user_data); void grpc_httpcli_set_override (grpc_httpcli_get_override get, grpc_httpcli_post_override post); diff --git a/src/core/httpcli/httpcli_security_connector.c b/src/core/httpcli/httpcli_security_connector.c index 00fb1fa458..5760f27f09 100644 --- a/src/core/httpcli/httpcli_security_connector.c +++ b/src/core/httpcli/httpcli_security_connector.c @@ -63,7 +63,7 @@ httpcli_ssl_destroy (grpc_security_connector * sc) } static void -httpcli_ssl_do_handshake (grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list) +httpcli_ssl_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data) { grpc_httpcli_ssl_channel_security_connector *c = (grpc_httpcli_ssl_channel_security_connector *) sc; tsi_result result = TSI_OK; @@ -143,12 +143,12 @@ httpcli_ssl_channel_security_connector_create (const unsigned char *pem_root_cer typedef struct { - void (*func) (void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list); + void (*func) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint); void *arg; } on_done_closure; static void -on_secure_transport_setup_done (void *rp, grpc_security_status status, grpc_endpoint * wrapped_endpoint, grpc_endpoint * secure_endpoint, grpc_closure_list * closure_list) +on_secure_transport_setup_done (grpc_exec_ctx * exec_ctx, void *rp, grpc_security_status status, grpc_endpoint * wrapped_endpoint, grpc_endpoint * secure_endpoint) { on_done_closure *c = rp; if (status != GRPC_SECURITY_OK) @@ -164,7 +164,7 @@ on_secure_transport_setup_done (void *rp, grpc_security_status status, grpc_endp } static void -ssl_handshake (void *arg, grpc_endpoint * tcp, const char *host, void (*on_done) (void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list), grpc_closure_list * closure_list) +ssl_handshake (void *arg, grpc_endpoint * tcp, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list)) { grpc_channel_security_connector *sc = NULL; const unsigned char *pem_root_certs = NULL; diff --git a/src/core/iomgr/alarm.c b/src/core/iomgr/alarm.c index 68455372e7..b10335c613 100644 --- a/src/core/iomgr/alarm.c +++ b/src/core/iomgr/alarm.c @@ -73,7 +73,7 @@ static shard_type g_shards[NUM_SHARDS]; /* Protected by g_mu */ static shard_type *g_shard_queue[NUM_SHARDS]; -static int run_some_expired_alarms (gpr_timespec now, gpr_timespec * next, int success, grpc_closure_list * closure_list); +static int run_some_expired_alarms (grpc_exec_ctx * exec_ctx, gpr_timespec now, gpr_timespec * next, int success); static gpr_timespec compute_min_deadline (shard_type * shard) @@ -183,7 +183,7 @@ note_deadline_change (shard_type * shard) } void -grpc_alarm_init (grpc_alarm * alarm, gpr_timespec deadline, grpc_iomgr_cb_func alarm_cb, void *alarm_cb_arg, gpr_timespec now, grpc_closure_list * closure_list) +grpc_alarm_init (grpc_exec_ctx * exec_ctx, grpc_alarm * alarm, gpr_timespec deadline, grpc_iomgr_cb_func alarm_cb, void *alarm_cb_arg, gpr_timespec now) { int is_first_alarm = 0; shard_type *shard = &g_shards[shard_idx (alarm)]; @@ -237,7 +237,7 @@ grpc_alarm_init (grpc_alarm * alarm, gpr_timespec deadline, grpc_iomgr_cb_func a } void -grpc_alarm_cancel (grpc_alarm * alarm, grpc_closure_list * closure_list) +grpc_alarm_cancel (grpc_exec_ctx * exec_ctx, grpc_alarm * alarm) { shard_type *shard = &g_shards[shard_idx (alarm)]; gpr_mu_lock (&shard->mu); @@ -313,7 +313,7 @@ pop_one (shard_type * shard, gpr_timespec now) /* REQUIRES: shard->mu unlocked */ static size_t -pop_alarms (shard_type * shard, gpr_timespec now, gpr_timespec * new_min_deadline, int success, grpc_closure_list * closure_list) +pop_alarms (grpc_exec_ctx * exec_ctx, shard_type * shard, gpr_timespec now, gpr_timespec * new_min_deadline, int success) { size_t n = 0; grpc_alarm *alarm; @@ -329,7 +329,7 @@ pop_alarms (shard_type * shard, gpr_timespec now, gpr_timespec * new_min_deadlin } static int -run_some_expired_alarms (gpr_timespec now, gpr_timespec * next, int success, grpc_closure_list * closure_list) +run_some_expired_alarms (grpc_exec_ctx * exec_ctx, gpr_timespec now, gpr_timespec * next, int success) { size_t n = 0; @@ -370,7 +370,7 @@ run_some_expired_alarms (gpr_timespec now, gpr_timespec * next, int success, grp } int -grpc_alarm_check (gpr_timespec now, gpr_timespec * next, grpc_closure_list * closure_list) +grpc_alarm_check (grpc_exec_ctx * exec_ctx, gpr_timespec now, gpr_timespec * next) { GPR_ASSERT (now.clock_type == g_clock_type); return run_some_expired_alarms (now, next, gpr_time_cmp (now, gpr_inf_future (now.clock_type)) != 0, closure_list); diff --git a/src/core/iomgr/alarm.h b/src/core/iomgr/alarm.h index 30cffa94a5..dc4ce29b46 100644 --- a/src/core/iomgr/alarm.h +++ b/src/core/iomgr/alarm.h @@ -55,7 +55,7 @@ typedef struct grpc_alarm and application code should check the status to determine how it was invoked. The application callback is also responsible for maintaining information about when to free up any user-level state. */ -void grpc_alarm_init (grpc_alarm * alarm, gpr_timespec deadline, grpc_iomgr_cb_func alarm_cb, void *alarm_cb_arg, gpr_timespec now, grpc_closure_list * closure_list); +void grpc_alarm_init (grpc_exec_ctx * exec_ctx, grpc_alarm * alarm, gpr_timespec deadline, grpc_iomgr_cb_func alarm_cb, void *alarm_cb_arg, gpr_timespec now); /* Note that there is no alarm destroy function. This is because the alarm is a one-time occurrence with a guarantee that the callback will @@ -83,6 +83,6 @@ void grpc_alarm_init (grpc_alarm * alarm, gpr_timespec deadline, grpc_iomgr_cb_f matches this aim. Requires: cancel() must happen after add() on a given alarm */ -void grpc_alarm_cancel (grpc_alarm * alarm, grpc_closure_list * closure_list); +void grpc_alarm_cancel (grpc_exec_ctx * exec_ctx, grpc_alarm * alarm); #endif /* GRPC_INTERNAL_CORE_IOMGR_ALARM_H */ diff --git a/src/core/iomgr/alarm_internal.h b/src/core/iomgr/alarm_internal.h index 5bcfee11cd..18ab48746f 100644 --- a/src/core/iomgr/alarm_internal.h +++ b/src/core/iomgr/alarm_internal.h @@ -49,7 +49,7 @@ with high probability at least one thread in the system will see an update at any time slice. */ -int grpc_alarm_check (gpr_timespec now, gpr_timespec * next, grpc_closure_list * closure_list); +int grpc_alarm_check (grpc_exec_ctx * exec_ctx, gpr_timespec now, gpr_timespec * next); void grpc_alarm_list_init (gpr_timespec now); void grpc_alarm_list_shutdown (grpc_closure_list * closure_list); diff --git a/src/core/iomgr/closure.h b/src/core/iomgr/closure.h index 3566f0b985..90d9e328a1 100644 --- a/src/core/iomgr/closure.h +++ b/src/core/iomgr/closure.h @@ -50,7 +50,7 @@ typedef struct grpc_closure_list * \param arg Arbitrary input. * \param success An indication on the state of the iomgr. On false, cleanup * actions should be taken (eg, shutdown). */ -typedef void (*grpc_iomgr_cb_func) (void *arg, int success, grpc_closure_list * closure_list); +typedef void (*grpc_iomgr_cb_func) (grpc_exec_ctx * exec_ctx, void *arg, int success); /** A closure over a grpc_iomgr_cb_func. */ struct grpc_closure diff --git a/src/core/iomgr/endpoint.c b/src/core/iomgr/endpoint.c index cc71177723..20ad7fee13 100644 --- a/src/core/iomgr/endpoint.c +++ b/src/core/iomgr/endpoint.c @@ -34,37 +34,37 @@ #include "src/core/iomgr/endpoint.h" void -grpc_endpoint_read (grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb, grpc_closure_list * closure_list) +grpc_endpoint_read (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb) { ep->vtable->read (ep, slices, cb, closure_list); } void -grpc_endpoint_write (grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb, grpc_closure_list * closure_list) +grpc_endpoint_write (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb) { ep->vtable->write (ep, slices, cb, closure_list); } void -grpc_endpoint_add_to_pollset (grpc_endpoint * ep, grpc_pollset * pollset, grpc_closure_list * closure_list) +grpc_endpoint_add_to_pollset (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, grpc_pollset * pollset) { ep->vtable->add_to_pollset (ep, pollset, closure_list); } void -grpc_endpoint_add_to_pollset_set (grpc_endpoint * ep, grpc_pollset_set * pollset_set, grpc_closure_list * closure_list) +grpc_endpoint_add_to_pollset_set (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, grpc_pollset_set * pollset_set) { ep->vtable->add_to_pollset_set (ep, pollset_set, closure_list); } void -grpc_endpoint_shutdown (grpc_endpoint * ep, grpc_closure_list * closure_list) +grpc_endpoint_shutdown (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep) { ep->vtable->shutdown (ep, closure_list); } void -grpc_endpoint_destroy (grpc_endpoint * ep, grpc_closure_list * closure_list) +grpc_endpoint_destroy (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep) { ep->vtable->destroy (ep, closure_list); } diff --git a/src/core/iomgr/endpoint.h b/src/core/iomgr/endpoint.h index 99d7f46e55..1a88b852e6 100644 --- a/src/core/iomgr/endpoint.h +++ b/src/core/iomgr/endpoint.h @@ -48,12 +48,12 @@ typedef struct grpc_endpoint_vtable grpc_endpoint_vtable; struct grpc_endpoint_vtable { - void (*read) (grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb, grpc_closure_list * closure_list); - void (*write) (grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb, grpc_closure_list * closure_list); - void (*add_to_pollset) (grpc_endpoint * ep, grpc_pollset * pollset, grpc_closure_list * closure_list); - void (*add_to_pollset_set) (grpc_endpoint * ep, grpc_pollset_set * pollset, grpc_closure_list * closure_list); - void (*shutdown) (grpc_endpoint * ep, grpc_closure_list * closure_list); - void (*destroy) (grpc_endpoint * ep, grpc_closure_list * closure_list); + void (*read) (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb); + void (*write) (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb); + void (*add_to_pollset) (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, grpc_pollset * pollset); + void (*add_to_pollset_set) (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, grpc_pollset_set * pollset); + void (*shutdown) (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep); + void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep); char *(*get_peer) (grpc_endpoint * ep); }; @@ -61,7 +61,7 @@ struct grpc_endpoint_vtable Callback success indicates that the endpoint can accept more reads, failure indicates the endpoint is closed. Valid slices may be placed into \a slices even on callback success == 0. */ -void grpc_endpoint_read (grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb, grpc_closure_list * closure_list); +void grpc_endpoint_read (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb); char *grpc_endpoint_get_peer (grpc_endpoint * ep); @@ -75,17 +75,17 @@ char *grpc_endpoint_get_peer (grpc_endpoint * ep); No guarantee is made to the content of slices after a write EXCEPT that it is a valid slice buffer. */ -void grpc_endpoint_write (grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb, grpc_closure_list * closure_list); +void grpc_endpoint_write (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, gpr_slice_buffer * slices, grpc_closure * cb); /* Causes any pending read/write callbacks to run immediately with success==0 */ -void grpc_endpoint_shutdown (grpc_endpoint * ep, grpc_closure_list * closure_list); -void grpc_endpoint_destroy (grpc_endpoint * ep, grpc_closure_list * closure_list); +void grpc_endpoint_shutdown (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep); +void grpc_endpoint_destroy (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep); /* Add an endpoint to a pollset, so that when the pollset is polled, events from this endpoint are considered */ -void grpc_endpoint_add_to_pollset (grpc_endpoint * ep, grpc_pollset * pollset, grpc_closure_list * closure_list); -void grpc_endpoint_add_to_pollset_set (grpc_endpoint * ep, grpc_pollset_set * pollset_set, grpc_closure_list * closure_list); +void grpc_endpoint_add_to_pollset (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, grpc_pollset * pollset); +void grpc_endpoint_add_to_pollset_set (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, grpc_pollset_set * pollset_set); struct grpc_endpoint { diff --git a/src/core/iomgr/fd_posix.c b/src/core/iomgr/fd_posix.c index 279ed28001..8ae63e2a89 100644 --- a/src/core/iomgr/fd_posix.c +++ b/src/core/iomgr/fd_posix.c @@ -252,7 +252,7 @@ has_watchers (grpc_fd * fd) } void -grpc_fd_orphan (grpc_fd * fd, grpc_closure * on_done, const char *reason, grpc_closure_list * closure_list) +grpc_fd_orphan (grpc_exec_ctx * exec_ctx, grpc_fd * fd, grpc_closure * on_done, const char *reason) { fd->on_done_closure = on_done; shutdown (fd->fd, SHUT_RDWR); @@ -300,7 +300,7 @@ grpc_fd_unref (grpc_fd * fd) #endif static void -notify_on (grpc_fd * fd, gpr_atm * st, grpc_closure * closure, grpc_closure_list * closure_list) +notify_on (grpc_exec_ctx * exec_ctx, grpc_fd * fd, gpr_atm * st, grpc_closure * closure) { switch (gpr_atm_acq_load (st)) { @@ -337,7 +337,7 @@ notify_on (grpc_fd * fd, gpr_atm * st, grpc_closure * closure, grpc_closure_list } static void -set_ready_locked (grpc_fd * fd, gpr_atm * st, grpc_closure_list * closure_list) +set_ready_locked (grpc_exec_ctx * exec_ctx, grpc_fd * fd, gpr_atm * st) { gpr_intptr state = gpr_atm_acq_load (st); @@ -365,7 +365,7 @@ set_ready_locked (grpc_fd * fd, gpr_atm * st, grpc_closure_list * closure_list) } static void -set_ready (grpc_fd * fd, gpr_atm * st, grpc_closure_list * closure_list) +set_ready (grpc_exec_ctx * exec_ctx, grpc_fd * fd, gpr_atm * st) { /* only one set_ready can be active at once (but there may be a racing notify_on) */ @@ -375,7 +375,7 @@ set_ready (grpc_fd * fd, gpr_atm * st, grpc_closure_list * closure_list) } void -grpc_fd_shutdown (grpc_fd * fd, grpc_closure_list * closure_list) +grpc_fd_shutdown (grpc_exec_ctx * exec_ctx, grpc_fd * fd) { gpr_mu_lock (&fd->set_state_mu); GPR_ASSERT (!gpr_atm_no_barrier_load (&fd->shutdown)); @@ -386,13 +386,13 @@ grpc_fd_shutdown (grpc_fd * fd, grpc_closure_list * closure_list) } void -grpc_fd_notify_on_read (grpc_fd * fd, grpc_closure * closure, grpc_closure_list * closure_list) +grpc_fd_notify_on_read (grpc_exec_ctx * exec_ctx, grpc_fd * fd, grpc_closure * closure) { notify_on (fd, &fd->readst, closure, closure_list); } void -grpc_fd_notify_on_write (grpc_fd * fd, grpc_closure * closure, grpc_closure_list * closure_list) +grpc_fd_notify_on_write (grpc_exec_ctx * exec_ctx, grpc_fd * fd, grpc_closure * closure) { notify_on (fd, &fd->writest, closure, closure_list); } @@ -443,7 +443,7 @@ grpc_fd_begin_poll (grpc_fd * fd, grpc_pollset * pollset, gpr_uint32 read_mask, } void -grpc_fd_end_poll (grpc_fd_watcher * watcher, int got_read, int got_write, grpc_closure_list * closure_list) +grpc_fd_end_poll (grpc_exec_ctx * exec_ctx, grpc_fd_watcher * watcher, int got_read, int got_write) { int was_polling = 0; int kick = 0; @@ -491,13 +491,13 @@ grpc_fd_end_poll (grpc_fd_watcher * watcher, int got_read, int got_write, grpc_c } void -grpc_fd_become_readable (grpc_fd * fd, grpc_closure_list * closure_list) +grpc_fd_become_readable (grpc_exec_ctx * exec_ctx, grpc_fd * fd) { set_ready (fd, &fd->readst, closure_list); } void -grpc_fd_become_writable (grpc_fd * fd, grpc_closure_list * closure_list) +grpc_fd_become_writable (grpc_exec_ctx * exec_ctx, grpc_fd * fd) { set_ready (fd, &fd->writest, closure_list); } diff --git a/src/core/iomgr/fd_posix.h b/src/core/iomgr/fd_posix.h index 53850f4417..550de3753e 100644 --- a/src/core/iomgr/fd_posix.h +++ b/src/core/iomgr/fd_posix.h @@ -113,7 +113,7 @@ grpc_fd *grpc_fd_create (int fd, const char *name); Requires: *fd initialized; no outstanding notify_on_read or notify_on_write. MUST NOT be called with a pollset lock taken */ -void grpc_fd_orphan (grpc_fd * fd, grpc_closure * on_done, const char *reason, grpc_closure_list * closure_list); +void grpc_fd_orphan (grpc_exec_ctx * exec_ctx, grpc_fd * fd, grpc_closure * on_done, const char *reason); /* Begin polling on an fd. Registers that the given pollset is interested in this fd - so that if read @@ -129,13 +129,13 @@ void grpc_fd_orphan (grpc_fd * fd, grpc_closure * on_done, const char *reason, g gpr_uint32 grpc_fd_begin_poll (grpc_fd * fd, grpc_pollset * pollset, gpr_uint32 read_mask, gpr_uint32 write_mask, grpc_fd_watcher * rec); /* Complete polling previously started with grpc_fd_begin_poll MUST NOT be called with a pollset lock taken */ -void grpc_fd_end_poll (grpc_fd_watcher * rec, int got_read, int got_write, grpc_closure_list * closure_list); +void grpc_fd_end_poll (grpc_exec_ctx * exec_ctx, grpc_fd_watcher * rec, int got_read, int got_write); /* Return 1 if this fd is orphaned, 0 otherwise */ int grpc_fd_is_orphaned (grpc_fd * fd); /* Cause any current callbacks to error out with GRPC_CALLBACK_CANCELLED. */ -void grpc_fd_shutdown (grpc_fd * fd, grpc_closure_list * closure_list); +void grpc_fd_shutdown (grpc_exec_ctx * exec_ctx, grpc_fd * fd); /* Register read interest, causing read_cb to be called once when fd becomes readable, on deadline specified by deadline, or on shutdown triggered by @@ -150,17 +150,17 @@ void grpc_fd_shutdown (grpc_fd * fd, grpc_closure_list * closure_list); underlying platform. This means that users must drain fd in read_cb before calling notify_on_read again. Users are also expected to handle spurious events, i.e read_cb is called while nothing can be readable from fd */ -void grpc_fd_notify_on_read (grpc_fd * fd, grpc_closure * closure, grpc_closure_list * closure_list); +void grpc_fd_notify_on_read (grpc_exec_ctx * exec_ctx, grpc_fd * fd, grpc_closure * closure); /* Exactly the same semantics as above, except based on writable events. */ -void grpc_fd_notify_on_write (grpc_fd * fd, grpc_closure * closure, grpc_closure_list * closure_list); +void grpc_fd_notify_on_write (grpc_exec_ctx * exec_ctx, grpc_fd * fd, grpc_closure * closure); /* Notification from the poller to an fd that it has become readable or writable. If allow_synchronous_callback is 1, allow running the fd callback inline in this callstack, otherwise register an asynchronous callback and return */ -void grpc_fd_become_readable (grpc_fd * fd, grpc_closure_list * closure_list); -void grpc_fd_become_writable (grpc_fd * fd, grpc_closure_list * closure_list); +void grpc_fd_become_readable (grpc_exec_ctx * exec_ctx, grpc_fd * fd); +void grpc_fd_become_writable (grpc_exec_ctx * exec_ctx, grpc_fd * fd); /* Reference counting for fds */ #ifdef GRPC_FD_REF_COUNT_DEBUG diff --git a/src/core/iomgr/pollset.h b/src/core/iomgr/pollset.h index f17a85d8a8..11f0c592e6 100644 --- a/src/core/iomgr/pollset.h +++ b/src/core/iomgr/pollset.h @@ -55,7 +55,7 @@ #endif void grpc_pollset_init (grpc_pollset * pollset); -void grpc_pollset_shutdown (grpc_pollset * pollset, grpc_closure * closure, grpc_closure_list * closure_list); +void grpc_pollset_shutdown (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_closure * closure); void grpc_pollset_destroy (grpc_pollset * pollset); /* Do some work on a pollset. @@ -76,7 +76,7 @@ void grpc_pollset_destroy (grpc_pollset * pollset); May call grpc_closure_list_run on grpc_closure_list, without holding the pollset lock */ -void grpc_pollset_work (grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec now, gpr_timespec deadline, grpc_closure_list * closure_list); +void grpc_pollset_work (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec now, gpr_timespec deadline); /* Break one polling thread out of polling work for this pollset. If specific_worker is GRPC_POLLSET_KICK_BROADCAST, kick ALL the workers. diff --git a/src/core/iomgr/pollset_multipoller_with_epoll.c b/src/core/iomgr/pollset_multipoller_with_epoll.c index 2f824882a6..e5f0d99e54 100644 --- a/src/core/iomgr/pollset_multipoller_with_epoll.c +++ b/src/core/iomgr/pollset_multipoller_with_epoll.c @@ -65,7 +65,7 @@ typedef struct } pollset_hdr; static void -finally_add_fd (grpc_pollset * pollset, grpc_fd * fd, grpc_closure_list * closure_list) +finally_add_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd * fd) { pollset_hdr *h = pollset->data.ptr; struct epoll_event ev; @@ -94,7 +94,7 @@ finally_add_fd (grpc_pollset * pollset, grpc_fd * fd, grpc_closure_list * closur } static void -perform_delayed_add (void *arg, int iomgr_status, grpc_closure_list * closure_list) +perform_delayed_add (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_status) { delayed_add *da = arg; @@ -122,7 +122,7 @@ perform_delayed_add (void *arg, int iomgr_status, grpc_closure_list * closure_li } static void -multipoll_with_epoll_pollset_add_fd (grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset, grpc_closure_list * closure_list) +multipoll_with_epoll_pollset_add_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset) { if (and_unlock_pollset) { @@ -142,7 +142,7 @@ multipoll_with_epoll_pollset_add_fd (grpc_pollset * pollset, grpc_fd * fd, int a } static void -multipoll_with_epoll_pollset_del_fd (grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset, grpc_closure_list * closure_list) +multipoll_with_epoll_pollset_del_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset) { pollset_hdr *h = pollset->data.ptr; int err; @@ -165,7 +165,7 @@ multipoll_with_epoll_pollset_del_fd (grpc_pollset * pollset, grpc_fd * fd, int a #define GRPC_EPOLL_MAX_EVENTS 1000 static void -multipoll_with_epoll_pollset_maybe_work_and_unlock (grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec deadline, gpr_timespec now, grpc_closure_list * closure_list) +multipoll_with_epoll_pollset_maybe_work_and_unlock (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec deadline, gpr_timespec now) { struct epoll_event ep_ev[GRPC_EPOLL_MAX_EVENTS]; int ep_rv; @@ -270,7 +270,7 @@ static const grpc_pollset_vtable multipoll_with_epoll_pollset = { }; static void -epoll_become_multipoller (grpc_pollset * pollset, grpc_fd ** fds, size_t nfds, grpc_closure_list * closure_list) +epoll_become_multipoller (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd ** fds, size_t nfds) { size_t i; pollset_hdr *h = gpr_malloc (sizeof (pollset_hdr)); diff --git a/src/core/iomgr/pollset_multipoller_with_poll_posix.c b/src/core/iomgr/pollset_multipoller_with_poll_posix.c index 9e3f6d2a0e..8417b7491a 100644 --- a/src/core/iomgr/pollset_multipoller_with_poll_posix.c +++ b/src/core/iomgr/pollset_multipoller_with_poll_posix.c @@ -61,7 +61,7 @@ typedef struct } pollset_hdr; static void -multipoll_with_poll_pollset_add_fd (grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset, grpc_closure_list * closure_list) +multipoll_with_poll_pollset_add_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset) { size_t i; pollset_hdr *h = pollset->data.ptr; @@ -86,7 +86,7 @@ exit: } static void -multipoll_with_poll_pollset_del_fd (grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset, grpc_closure_list * closure_list) +multipoll_with_poll_pollset_del_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset) { /* will get removed next poll cycle */ pollset_hdr *h = pollset->data.ptr; @@ -104,7 +104,7 @@ multipoll_with_poll_pollset_del_fd (grpc_pollset * pollset, grpc_fd * fd, int an } static void -multipoll_with_poll_pollset_maybe_work_and_unlock (grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec deadline, gpr_timespec now, grpc_closure_list * closure_list) +multipoll_with_poll_pollset_maybe_work_and_unlock (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec deadline, gpr_timespec now) { int timeout; int r; @@ -239,7 +239,7 @@ static const grpc_pollset_vtable multipoll_with_poll_pollset = { }; void -grpc_poll_become_multipoller (grpc_pollset * pollset, grpc_fd ** fds, size_t nfds, grpc_closure_list * closure_list) +grpc_poll_become_multipoller (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd ** fds, size_t nfds) { size_t i; pollset_hdr *h = gpr_malloc (sizeof (pollset_hdr)); diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index 93ab7faa30..ad5c42aac3 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -169,7 +169,7 @@ grpc_pollset_init (grpc_pollset * pollset) } void -grpc_pollset_add_fd (grpc_pollset * pollset, grpc_fd * fd, grpc_closure_list * closure_list) +grpc_pollset_add_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd * fd) { gpr_mu_lock (&pollset->mu); pollset->vtable->add_fd (pollset, fd, 1, closure_list); @@ -184,7 +184,7 @@ grpc_pollset_add_fd (grpc_pollset * pollset, grpc_fd * fd, grpc_closure_list * c } void -grpc_pollset_del_fd (grpc_pollset * pollset, grpc_fd * fd, grpc_closure_list * closure_list) +grpc_pollset_del_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd * fd) { gpr_mu_lock (&pollset->mu); pollset->vtable->del_fd (pollset, fd, 1, closure_list); @@ -199,14 +199,14 @@ grpc_pollset_del_fd (grpc_pollset * pollset, grpc_fd * fd, grpc_closure_list * c } static void -finish_shutdown (grpc_pollset * pollset, grpc_closure_list * closure_list) +finish_shutdown (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset) { pollset->vtable->finish_shutdown (pollset); grpc_closure_list_add (closure_list, pollset->shutdown_done, 1); } void -grpc_pollset_work (grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec now, gpr_timespec deadline, grpc_closure_list * closure_list) +grpc_pollset_work (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec now, gpr_timespec deadline) { /* pollset->mu already held */ int added_worker = 0; @@ -282,7 +282,7 @@ done: } void -grpc_pollset_shutdown (grpc_pollset * pollset, grpc_closure * closure, grpc_closure_list * closure_list) +grpc_pollset_shutdown (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_closure * closure) { int call_shutdown = 0; gpr_mu_lock (&pollset->mu); @@ -344,7 +344,7 @@ typedef struct grpc_unary_promote_args } grpc_unary_promote_args; static void -basic_do_promote (void *args, int success, grpc_closure_list * closure_list) +basic_do_promote (grpc_exec_ctx * exec_ctx, void *args, int success) { grpc_unary_promote_args *up_args = args; const grpc_pollset_vtable *original_vtable = up_args->original_vtable; @@ -422,7 +422,7 @@ basic_do_promote (void *args, int success, grpc_closure_list * closure_list) } static void -basic_pollset_add_fd (grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset, grpc_closure_list * closure_list) +basic_pollset_add_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset) { grpc_unary_promote_args *up_args; GPR_ASSERT (fd); @@ -481,7 +481,7 @@ exit: } static void -basic_pollset_del_fd (grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset, grpc_closure_list * closure_list) +basic_pollset_del_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd * fd, int and_unlock_pollset) { GPR_ASSERT (fd); if (fd == pollset->data.ptr) @@ -497,7 +497,7 @@ basic_pollset_del_fd (grpc_pollset * pollset, grpc_fd * fd, int and_unlock_polls } static void -basic_pollset_maybe_work_and_unlock (grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec deadline, gpr_timespec now, grpc_closure_list * closure_list) +basic_pollset_maybe_work_and_unlock (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec deadline, gpr_timespec now) { struct pollfd pfd[2]; grpc_fd *fd; diff --git a/src/core/iomgr/pollset_posix.h b/src/core/iomgr/pollset_posix.h index 6bcc4f6a61..91cf93580f 100644 --- a/src/core/iomgr/pollset_posix.h +++ b/src/core/iomgr/pollset_posix.h @@ -79,9 +79,9 @@ typedef struct grpc_pollset struct grpc_pollset_vtable { - void (*add_fd) (grpc_pollset * pollset, struct grpc_fd * fd, int and_unlock_pollset, grpc_closure_list * closure_list); - void (*del_fd) (grpc_pollset * pollset, struct grpc_fd * fd, int and_unlock_pollset, grpc_closure_list * closure_list); - void (*maybe_work_and_unlock) (grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec deadline, gpr_timespec now, grpc_closure_list * closure_list); + void (*add_fd) (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, struct grpc_fd * fd, int and_unlock_pollset); + void (*del_fd) (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, struct grpc_fd * fd, int and_unlock_pollset); + void (*maybe_work_and_unlock) (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_pollset_worker * worker, gpr_timespec deadline, gpr_timespec now); void (*finish_shutdown) (grpc_pollset * pollset); void (*destroy) (grpc_pollset * pollset); }; @@ -89,10 +89,10 @@ struct grpc_pollset_vtable #define GRPC_POLLSET_MU(pollset) (&(pollset)->mu) /* Add an fd to a pollset */ -void grpc_pollset_add_fd (grpc_pollset * pollset, struct grpc_fd *fd, grpc_closure_list * closure_list); +void grpc_pollset_add_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, struct grpc_fd *fd); /* Force remove an fd from a pollset (normally they are removed on the next poll after an fd is orphaned) */ -void grpc_pollset_del_fd (grpc_pollset * pollset, struct grpc_fd *fd, grpc_closure_list * closure_list); +void grpc_pollset_del_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, struct grpc_fd *fd); /* Returns the fd to listen on for kicks */ int grpc_kick_read_fd (grpc_pollset * p); @@ -109,10 +109,10 @@ void grpc_kick_drain (grpc_pollset * p); int grpc_poll_deadline_to_millis_timeout (gpr_timespec deadline, gpr_timespec now); /* turn a pollset into a multipoller: platform specific */ -typedef void (*grpc_platform_become_multipoller_type) (grpc_pollset * pollset, struct grpc_fd ** fds, size_t fd_count, grpc_closure_list * closure_list); +typedef void (*grpc_platform_become_multipoller_type) (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, struct grpc_fd ** fds, size_t fd_count); extern grpc_platform_become_multipoller_type grpc_platform_become_multipoller; -void grpc_poll_become_multipoller (grpc_pollset * pollset, struct grpc_fd **fds, size_t fd_count, grpc_closure_list * closure_list); +void grpc_poll_become_multipoller (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, struct grpc_fd **fds, size_t fd_count); /* Return 1 if the pollset has active threads in grpc_pollset_work (pollset must * be locked) */ diff --git a/src/core/iomgr/pollset_set.h b/src/core/iomgr/pollset_set.h index 3e5cd8d7e6..a777c6ca23 100644 --- a/src/core/iomgr/pollset_set.h +++ b/src/core/iomgr/pollset_set.h @@ -51,7 +51,7 @@ void grpc_pollset_set_init (grpc_pollset_set * pollset_set); void grpc_pollset_set_destroy (grpc_pollset_set * pollset_set); -void grpc_pollset_set_add_pollset (grpc_pollset_set * pollset_set, grpc_pollset * pollset, grpc_closure_list * closure_list); -void grpc_pollset_set_del_pollset (grpc_pollset_set * pollset_set, grpc_pollset * pollset, grpc_closure_list * closure_list); +void grpc_pollset_set_add_pollset (grpc_exec_ctx * exec_ctx, grpc_pollset_set * pollset_set, grpc_pollset * pollset); +void grpc_pollset_set_del_pollset (grpc_exec_ctx * exec_ctx, grpc_pollset_set * pollset_set, grpc_pollset * pollset); #endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_H */ diff --git a/src/core/iomgr/pollset_set_posix.c b/src/core/iomgr/pollset_set_posix.c index 285f4eb24a..83be0b91c9 100644 --- a/src/core/iomgr/pollset_set_posix.c +++ b/src/core/iomgr/pollset_set_posix.c @@ -64,7 +64,7 @@ grpc_pollset_set_destroy (grpc_pollset_set * pollset_set) } void -grpc_pollset_set_add_pollset (grpc_pollset_set * pollset_set, grpc_pollset * pollset, grpc_closure_list * closure_list) +grpc_pollset_set_add_pollset (grpc_exec_ctx * exec_ctx, grpc_pollset_set * pollset_set, grpc_pollset * pollset) { size_t i, j; gpr_mu_lock (&pollset_set->mu); @@ -91,7 +91,7 @@ grpc_pollset_set_add_pollset (grpc_pollset_set * pollset_set, grpc_pollset * pol } void -grpc_pollset_set_del_pollset (grpc_pollset_set * pollset_set, grpc_pollset * pollset, grpc_closure_list * closure_list) +grpc_pollset_set_del_pollset (grpc_exec_ctx * exec_ctx, grpc_pollset_set * pollset_set, grpc_pollset * pollset) { size_t i; gpr_mu_lock (&pollset_set->mu); @@ -108,7 +108,7 @@ grpc_pollset_set_del_pollset (grpc_pollset_set * pollset_set, grpc_pollset * pol } void -grpc_pollset_set_add_fd (grpc_pollset_set * pollset_set, grpc_fd * fd, grpc_closure_list * closure_list) +grpc_pollset_set_add_fd (grpc_exec_ctx * exec_ctx, grpc_pollset_set * pollset_set, grpc_fd * fd) { size_t i; gpr_mu_lock (&pollset_set->mu); @@ -127,7 +127,7 @@ grpc_pollset_set_add_fd (grpc_pollset_set * pollset_set, grpc_fd * fd, grpc_clos } void -grpc_pollset_set_del_fd (grpc_pollset_set * pollset_set, grpc_fd * fd, grpc_closure_list * closure_list) +grpc_pollset_set_del_fd (grpc_exec_ctx * exec_ctx, grpc_pollset_set * pollset_set, grpc_fd * fd) { size_t i; gpr_mu_lock (&pollset_set->mu); diff --git a/src/core/iomgr/pollset_set_posix.h b/src/core/iomgr/pollset_set_posix.h index 2a4a045700..6075ae8f86 100644 --- a/src/core/iomgr/pollset_set_posix.h +++ b/src/core/iomgr/pollset_set_posix.h @@ -50,7 +50,7 @@ typedef struct grpc_pollset_set grpc_fd **fds; } grpc_pollset_set; -void grpc_pollset_set_add_fd (grpc_pollset_set * pollset_set, grpc_fd * fd, grpc_closure_list * closure_list); -void grpc_pollset_set_del_fd (grpc_pollset_set * pollset_set, grpc_fd * fd, grpc_closure_list * closure_list); +void grpc_pollset_set_add_fd (grpc_exec_ctx * exec_ctx, grpc_pollset_set * pollset_set, grpc_fd * fd); +void grpc_pollset_set_del_fd (grpc_exec_ctx * exec_ctx, grpc_pollset_set * pollset_set, grpc_fd * fd); #endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H */ diff --git a/src/core/iomgr/resolve_address.h b/src/core/iomgr/resolve_address.h index 44db1a7cc7..aeee82584a 100644 --- a/src/core/iomgr/resolve_address.h +++ b/src/core/iomgr/resolve_address.h @@ -56,7 +56,7 @@ typedef struct On success: addresses is the result, and the callee must call grpc_resolved_addresses_destroy when it's done with them On failure: addresses is NULL */ -typedef void (*grpc_resolve_cb) (void *arg, grpc_resolved_addresses * addresses, grpc_closure_list * closure_list); +typedef void (*grpc_resolve_cb) (grpc_exec_ctx * exec_ctx, void *arg, grpc_resolved_addresses * addresses); /* Asynchronously resolve addr. Use default_port if a port isn't designated in addr, otherwise use the port in addr. */ /* TODO(ctiller): add a timeout here */ diff --git a/src/core/iomgr/tcp_client.h b/src/core/iomgr/tcp_client.h index a97ca35128..2e14074006 100644 --- a/src/core/iomgr/tcp_client.h +++ b/src/core/iomgr/tcp_client.h @@ -44,6 +44,6 @@ NULL on failure). interested_parties points to a set of pollsets that would be interested in this connection being established (in order to continue their work) */ -void grpc_tcp_client_connect (grpc_closure * on_connect, grpc_endpoint ** endpoint, grpc_pollset_set * interested_parties, const struct sockaddr *addr, size_t addr_len, gpr_timespec deadline, grpc_closure_list * closure_list); +void grpc_tcp_client_connect (grpc_exec_ctx * exec_ctx, grpc_closure * on_connect, grpc_endpoint ** endpoint, grpc_pollset_set * interested_parties, const struct sockaddr *addr, size_t addr_len, gpr_timespec deadline); #endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H */ diff --git a/src/core/iomgr/tcp_client_posix.c b/src/core/iomgr/tcp_client_posix.c index 14255bda07..cca626228a 100644 --- a/src/core/iomgr/tcp_client_posix.c +++ b/src/core/iomgr/tcp_client_posix.c @@ -95,7 +95,7 @@ error: } static void -tc_on_alarm (void *acp, int success, grpc_closure_list * closure_list) +tc_on_alarm (grpc_exec_ctx * exec_ctx, void *acp, int success) { int done; async_connect *ac = acp; @@ -119,7 +119,7 @@ tc_on_alarm (void *acp, int success, grpc_closure_list * closure_list) } static void -on_writable (void *acp, int success, grpc_closure_list * closure_list) +on_writable (grpc_exec_ctx * exec_ctx, void *acp, int success) { async_connect *ac = acp; int so_error = 0; @@ -229,7 +229,7 @@ finish: } void -grpc_tcp_client_connect (grpc_closure * closure, grpc_endpoint ** ep, grpc_pollset_set * interested_parties, const struct sockaddr *addr, size_t addr_len, gpr_timespec deadline, grpc_closure_list * closure_list) +grpc_tcp_client_connect (grpc_exec_ctx * exec_ctx, grpc_closure * closure, grpc_endpoint ** ep, grpc_pollset_set * interested_parties, const struct sockaddr *addr, size_t addr_len, gpr_timespec deadline) { int fd; grpc_dualstack_mode dsmode; diff --git a/src/core/iomgr/tcp_posix.c b/src/core/iomgr/tcp_posix.c index da65a90eb4..bc9f566c6a 100644 --- a/src/core/iomgr/tcp_posix.c +++ b/src/core/iomgr/tcp_posix.c @@ -101,14 +101,14 @@ static void tcp_handle_write (void *arg /* grpc_tcp */ , int success, grpc_closure_list * closure_list); static void -tcp_shutdown (grpc_endpoint * ep, grpc_closure_list * closure_list) +tcp_shutdown (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep) { grpc_tcp *tcp = (grpc_tcp *) ep; grpc_fd_shutdown (tcp->em_fd, closure_list); } static void -tcp_free (grpc_tcp * tcp, grpc_closure_list * closure_list) +tcp_free (grpc_exec_ctx * exec_ctx, grpc_tcp * tcp) { grpc_fd_orphan (tcp->em_fd, NULL, "tcp_unref_orphan", closure_list); gpr_free (tcp->peer_string); @@ -140,7 +140,7 @@ tcp_ref (grpc_tcp * tcp, const char *reason, const char *file, int line) #define TCP_UNREF(tcp, reason, cl) tcp_unref((tcp), (cl)) #define TCP_REF(tcp, reason) tcp_ref((tcp)) static void -tcp_unref (grpc_tcp * tcp, grpc_closure_list * closure_list) +tcp_unref (grpc_exec_ctx * exec_ctx, grpc_tcp * tcp) { if (gpr_unref (&tcp->refcount)) { @@ -156,14 +156,14 @@ tcp_ref (grpc_tcp * tcp) #endif static void -tcp_destroy (grpc_endpoint * ep, grpc_closure_list * closure_list) +tcp_destroy (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep) { grpc_tcp *tcp = (grpc_tcp *) ep; TCP_UNREF (tcp, "destroy", closure_list); } static void -call_read_cb (grpc_tcp * tcp, int success, grpc_closure_list * closure_list) +call_read_cb (grpc_exec_ctx * exec_ctx, grpc_tcp * tcp, int success) { grpc_closure *cb = tcp->read_cb; @@ -187,7 +187,7 @@ call_read_cb (grpc_tcp * tcp, int success, grpc_closure_list * closure_list) #define MAX_READ_IOVEC 4 static void -tcp_continue_read (grpc_tcp * tcp, grpc_closure_list * closure_list) +tcp_continue_read (grpc_exec_ctx * exec_ctx, grpc_tcp * tcp) { struct msghdr msg; struct iovec iov[MAX_READ_IOVEC]; @@ -292,7 +292,7 @@ tcp_handle_read (void *arg /* grpc_tcp */ , int success, } static void -tcp_read (grpc_endpoint * ep, gpr_slice_buffer * incoming_buffer, grpc_closure * cb, grpc_closure_list * closure_list) +tcp_read (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, gpr_slice_buffer * incoming_buffer, grpc_closure * cb) { grpc_tcp *tcp = (grpc_tcp *) ep; GPR_ASSERT (tcp->read_cb == NULL); @@ -434,7 +434,7 @@ tcp_handle_write (void *arg /* grpc_tcp */ , int success, } static void -tcp_write (grpc_endpoint * ep, gpr_slice_buffer * buf, grpc_closure * cb, grpc_closure_list * closure_list) +tcp_write (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, gpr_slice_buffer * buf, grpc_closure * cb) { grpc_tcp *tcp = (grpc_tcp *) ep; flush_result status; @@ -480,14 +480,14 @@ tcp_write (grpc_endpoint * ep, gpr_slice_buffer * buf, grpc_closure * cb, grpc_c } static void -tcp_add_to_pollset (grpc_endpoint * ep, grpc_pollset * pollset, grpc_closure_list * closure_list) +tcp_add_to_pollset (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, grpc_pollset * pollset) { grpc_tcp *tcp = (grpc_tcp *) ep; grpc_pollset_add_fd (pollset, tcp->em_fd, closure_list); } static void -tcp_add_to_pollset_set (grpc_endpoint * ep, grpc_pollset_set * pollset_set, grpc_closure_list * closure_list) +tcp_add_to_pollset_set (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep, grpc_pollset_set * pollset_set) { grpc_tcp *tcp = (grpc_tcp *) ep; grpc_pollset_set_add_fd (pollset_set, tcp->em_fd, closure_list); diff --git a/src/core/iomgr/tcp_server.h b/src/core/iomgr/tcp_server.h index bb1d50576c..ee373a76bf 100644 --- a/src/core/iomgr/tcp_server.h +++ b/src/core/iomgr/tcp_server.h @@ -40,13 +40,13 @@ typedef struct grpc_tcp_server grpc_tcp_server; /* Called for newly connected TCP connections. */ -typedef void (*grpc_tcp_server_cb) (void *arg, grpc_endpoint * ep, grpc_closure_list * closure_list); +typedef void (*grpc_tcp_server_cb) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * ep); /* Create a server, initially not bound to any ports */ grpc_tcp_server *grpc_tcp_server_create (void); /* Start listening to bound ports */ -void grpc_tcp_server_start (grpc_tcp_server * server, grpc_pollset ** pollsets, size_t pollset_count, grpc_tcp_server_cb on_accept_cb, void *cb_arg, grpc_closure_list * closure_list); +void grpc_tcp_server_start (grpc_exec_ctx * exec_ctx, grpc_tcp_server * server, grpc_pollset ** pollsets, size_t pollset_count, grpc_tcp_server_cb on_accept_cb, void *cb_arg); /* Add a port to the server, returning port number on success, or negative on failure. @@ -68,6 +68,6 @@ int grpc_tcp_server_add_port (grpc_tcp_server * s, const void *addr, size_t addr up when grpc_tcp_server_destroy is called. */ int grpc_tcp_server_get_fd (grpc_tcp_server * s, unsigned index); -void grpc_tcp_server_destroy (grpc_tcp_server * server, grpc_closure * closure, grpc_closure_list * closure_list); +void grpc_tcp_server_destroy (grpc_exec_ctx * exec_ctx, grpc_tcp_server * server, grpc_closure * closure); #endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_SERVER_H */ diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c index 7b9cfe09cb..ee462aabd4 100644 --- a/src/core/iomgr/tcp_server_posix.c +++ b/src/core/iomgr/tcp_server_posix.c @@ -149,7 +149,7 @@ grpc_tcp_server_create (void) } static void -finish_shutdown (grpc_tcp_server * s, grpc_closure_list * closure_list) +finish_shutdown (grpc_exec_ctx * exec_ctx, grpc_tcp_server * s) { grpc_closure_list_add (closure_list, s->shutdown_complete, 1); @@ -160,7 +160,7 @@ finish_shutdown (grpc_tcp_server * s, grpc_closure_list * closure_list) } static void -destroyed_port (void *server, int success, grpc_closure_list * closure_list) +destroyed_port (grpc_exec_ctx * exec_ctx, void *server, int success) { grpc_tcp_server *s = server; gpr_mu_lock (&s->mu); @@ -181,7 +181,7 @@ destroyed_port (void *server, int success, grpc_closure_list * closure_list) events will be received on them - at this point it's safe to destroy things */ static void -deactivated_all_ports (grpc_tcp_server * s, grpc_closure_list * closure_list) +deactivated_all_ports (grpc_exec_ctx * exec_ctx, grpc_tcp_server * s) { size_t i; @@ -217,7 +217,7 @@ deactivated_all_ports (grpc_tcp_server * s, grpc_closure_list * closure_list) } void -grpc_tcp_server_destroy (grpc_tcp_server * s, grpc_closure * closure, grpc_closure_list * closure_list) +grpc_tcp_server_destroy (grpc_exec_ctx * exec_ctx, grpc_tcp_server * s, grpc_closure * closure) { size_t i; gpr_mu_lock (&s->mu); @@ -333,7 +333,7 @@ error: /* event manager callback when reads are ready */ static void -on_read (void *arg, int success, grpc_closure_list * closure_list) +on_read (grpc_exec_ctx * exec_ctx, void *arg, int success) { server_port *sp = arg; grpc_fd *fdobj; @@ -542,7 +542,7 @@ grpc_tcp_server_get_fd (grpc_tcp_server * s, unsigned index) } void -grpc_tcp_server_start (grpc_tcp_server * s, grpc_pollset ** pollsets, size_t pollset_count, grpc_tcp_server_cb on_accept_cb, void *on_accept_cb_arg, grpc_closure_list * closure_list) +grpc_tcp_server_start (grpc_exec_ctx * exec_ctx, grpc_tcp_server * s, grpc_pollset ** pollsets, size_t pollset_count, grpc_tcp_server_cb on_accept_cb, void *on_accept_cb_arg) { size_t i, j; GPR_ASSERT (on_accept_cb); diff --git a/src/core/iomgr/udp_server.c b/src/core/iomgr/udp_server.c index 490b3de205..2f45011a89 100644 --- a/src/core/iomgr/udp_server.c +++ b/src/core/iomgr/udp_server.c @@ -142,7 +142,7 @@ grpc_udp_server_create (void) } static void -finish_shutdown (grpc_udp_server * s, grpc_closure_list * closure_list) +finish_shutdown (grpc_exec_ctx * exec_ctx, grpc_udp_server * s) { grpc_closure_list_add (closure_list, s->shutdown_complete, 1); @@ -154,7 +154,7 @@ finish_shutdown (grpc_udp_server * s, grpc_closure_list * closure_list) } static void -destroyed_port (void *server, int success, grpc_closure_list * closure_list) +destroyed_port (grpc_exec_ctx * exec_ctx, void *server, int success) { grpc_udp_server *s = server; gpr_mu_lock (&s->mu); @@ -174,7 +174,7 @@ destroyed_port (void *server, int success, grpc_closure_list * closure_list) events will be received on them - at this point it's safe to destroy things */ static void -deactivated_all_ports (grpc_udp_server * s, grpc_closure_list * closure_list) +deactivated_all_ports (grpc_exec_ctx * exec_ctx, grpc_udp_server * s) { size_t i; @@ -210,7 +210,7 @@ deactivated_all_ports (grpc_udp_server * s, grpc_closure_list * closure_list) } void -grpc_udp_server_destroy (grpc_udp_server * s, grpc_closure * on_done, grpc_closure_list * closure_list) +grpc_udp_server_destroy (grpc_exec_ctx * exec_ctx, grpc_udp_server * s, grpc_closure * on_done) { size_t i; gpr_mu_lock (&s->mu); @@ -292,7 +292,7 @@ error: /* event manager callback when reads are ready */ static void -on_read (void *arg, int success, grpc_closure_list * closure_list) +on_read (grpc_exec_ctx * exec_ctx, void *arg, int success) { server_port *sp = arg; @@ -451,7 +451,7 @@ grpc_udp_server_get_fd (grpc_udp_server * s, unsigned index) } void -grpc_udp_server_start (grpc_udp_server * s, grpc_pollset ** pollsets, size_t pollset_count, grpc_closure_list * closure_list) +grpc_udp_server_start (grpc_exec_ctx * exec_ctx, grpc_udp_server * s, grpc_pollset ** pollsets, size_t pollset_count) { size_t i, j; gpr_mu_lock (&s->mu); diff --git a/src/core/iomgr/udp_server.h b/src/core/iomgr/udp_server.h index 458773a121..e37d0485c1 100644 --- a/src/core/iomgr/udp_server.h +++ b/src/core/iomgr/udp_server.h @@ -46,7 +46,7 @@ typedef void (*grpc_udp_server_read_cb) (int fd); grpc_udp_server *grpc_udp_server_create (void); /* Start listening to bound ports */ -void grpc_udp_server_start (grpc_udp_server * udp_server, grpc_pollset ** pollsets, size_t pollset_count, grpc_closure_list * closure_list); +void grpc_udp_server_start (grpc_exec_ctx * exec_ctx, grpc_udp_server * udp_server, grpc_pollset ** pollsets, size_t pollset_count); int grpc_udp_server_get_fd (grpc_udp_server * s, unsigned index); @@ -62,7 +62,7 @@ int grpc_udp_server_get_fd (grpc_udp_server * s, unsigned index); all of the multiple socket port matching logic in one place */ int grpc_udp_server_add_port (grpc_udp_server * s, const void *addr, size_t addr_len, grpc_udp_server_read_cb read_cb); -void grpc_udp_server_destroy (grpc_udp_server * server, grpc_closure * on_done, grpc_closure_list * closure_list); +void grpc_udp_server_destroy (grpc_exec_ctx * exec_ctx, grpc_udp_server * server, grpc_closure * on_done); /* Write the contents of buffer to the underlying UDP socket. */ /* diff --git a/src/core/iomgr/workqueue.h b/src/core/iomgr/workqueue.h index 8a825ba8e3..c5d7c64e83 100644 --- a/src/core/iomgr/workqueue.h +++ b/src/core/iomgr/workqueue.h @@ -53,7 +53,7 @@ typedef struct grpc_workqueue grpc_workqueue; /** Create a work queue */ grpc_workqueue *grpc_workqueue_create (grpc_closure_list * closure_list); -void grpc_workqueue_flush (grpc_workqueue * workqueue, grpc_closure_list * closure_list); +void grpc_workqueue_flush (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue); #define GRPC_WORKQUEUE_REFCOUNT_DEBUG #ifdef GRPC_WORKQUEUE_REFCOUNT_DEBUG @@ -67,11 +67,11 @@ void grpc_workqueue_unref (grpc_workqueue * workqueue, grpc_closure_list * closu #define GRPC_WORKQUEUE_REF(p, r) grpc_workqueue_ref((p)) #define GRPC_WORKQUEUE_UNREF(p, r, cl) grpc_workqueue_unref((p), (cl)) void grpc_workqueue_ref (grpc_workqueue * workqueue); -void grpc_workqueue_unref (grpc_workqueue * workqueue, grpc_closure_list * closure_list); +void grpc_workqueue_unref (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue); #endif /** Bind this workqueue to a pollset */ -void grpc_workqueue_add_to_pollset (grpc_workqueue * workqueue, grpc_pollset * pollset, grpc_closure_list * closure_list); +void grpc_workqueue_add_to_pollset (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue, grpc_pollset * pollset); /** Add a work item to a workqueue */ void grpc_workqueue_push (grpc_workqueue * workqueue, grpc_closure * closure, int success); diff --git a/src/core/iomgr/workqueue_posix.c b/src/core/iomgr/workqueue_posix.c index e13404b261..1aadaa4028 100644 --- a/src/core/iomgr/workqueue_posix.c +++ b/src/core/iomgr/workqueue_posix.c @@ -45,7 +45,7 @@ #include "src/core/iomgr/fd_posix.h" -static void on_readable (void *arg, int success, grpc_closure_list * closure_list); +static void on_readable (grpc_exec_ctx * exec_ctx, void *arg, int success); grpc_workqueue * grpc_workqueue_create (grpc_closure_list * closure_list) @@ -64,7 +64,7 @@ grpc_workqueue_create (grpc_closure_list * closure_list) } static void -workqueue_destroy (grpc_workqueue * workqueue, grpc_closure_list * closure_list) +workqueue_destroy (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue) { GPR_ASSERT (grpc_closure_list_empty (workqueue->closure_list)); grpc_fd_shutdown (workqueue->wakeup_read_fd, closure_list); @@ -90,7 +90,7 @@ grpc_workqueue_unref (grpc_workqueue * workqueue, grpc_closure_list * closure_li gpr_log (file, line, GPR_LOG_SEVERITY_DEBUG, "WORKQUEUE:%p unref %d -> %d %s", workqueue, (int) workqueue->refs.count, (int) workqueue->refs.count - 1, reason); #else void -grpc_workqueue_unref (grpc_workqueue * workqueue, grpc_closure_list * closure_list) +grpc_workqueue_unref (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue) { #endif if (gpr_unref (&workqueue->refs)) @@ -100,13 +100,13 @@ grpc_workqueue_unref (grpc_workqueue * workqueue, grpc_closure_list * closure_li } void -grpc_workqueue_add_to_pollset (grpc_workqueue * workqueue, grpc_pollset * pollset, grpc_closure_list * closure_list) +grpc_workqueue_add_to_pollset (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue, grpc_pollset * pollset) { grpc_pollset_add_fd (pollset, workqueue->wakeup_read_fd, closure_list); } void -grpc_workqueue_flush (grpc_workqueue * workqueue, grpc_closure_list * closure_list) +grpc_workqueue_flush (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue) { gpr_mu_lock (&workqueue->mu); grpc_closure_list_move (&workqueue->closure_list, closure_list); @@ -114,7 +114,7 @@ grpc_workqueue_flush (grpc_workqueue * workqueue, grpc_closure_list * closure_li } static void -on_readable (void *arg, int success, grpc_closure_list * closure_list) +on_readable (grpc_exec_ctx * exec_ctx, void *arg, int success) { grpc_workqueue *workqueue = arg; diff --git a/src/core/security/client_auth_filter.c b/src/core/security/client_auth_filter.c index 660ef713fa..89ac3f464f 100644 --- a/src/core/security/client_auth_filter.c +++ b/src/core/security/client_auth_filter.c @@ -89,7 +89,7 @@ reset_service_url (call_data * calld) } static void -bubble_up_error (grpc_call_element * elem, grpc_status_code status, const char *error_msg, grpc_closure_list * closure_list) +bubble_up_error (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_status_code status, const char *error_msg) { call_data *calld = elem->call_data; gpr_log (GPR_ERROR, "Client side authentication failure: %s", error_msg); @@ -98,7 +98,7 @@ bubble_up_error (grpc_call_element * elem, grpc_status_code status, const char * } static void -on_credentials_metadata (void *user_data, grpc_credentials_md * md_elems, size_t num_md, grpc_credentials_status status, grpc_closure_list * closure_list) +on_credentials_metadata (grpc_exec_ctx * exec_ctx, void *user_data, grpc_credentials_md * md_elems, size_t num_md, grpc_credentials_status status) { grpc_call_element *elem = (grpc_call_element *) user_data; call_data *calld = elem->call_data; @@ -149,7 +149,7 @@ build_service_url (const char *url_scheme, call_data * calld) } static void -send_security_metadata (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +send_security_metadata (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; @@ -186,7 +186,7 @@ send_security_metadata (grpc_call_element * elem, grpc_transport_stream_op * op, } static void -on_host_checked (void *user_data, grpc_security_status status, grpc_closure_list * closure_list) +on_host_checked (grpc_exec_ctx * exec_ctx, void *user_data, grpc_security_status status) { grpc_call_element *elem = (grpc_call_element *) user_data; call_data *calld = elem->call_data; @@ -210,7 +210,7 @@ on_host_checked (void *user_data, grpc_security_status status, grpc_closure_list op contains type and call direction information, in addition to the data that is being sent or received. */ static void -auth_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +auth_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { /* grab pointers to our data from the call element */ call_data *calld = elem->call_data; @@ -296,7 +296,7 @@ auth_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * op /* Constructor for call_data */ static void -init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { call_data *calld = elem->call_data; memset (calld, 0, sizeof (*calld)); @@ -305,7 +305,7 @@ init_call_elem (grpc_call_element * elem, const void *server_transport_data, grp /* Destructor for call_data */ static void -destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { call_data *calld = elem->call_data; grpc_credentials_unref (calld->creds); @@ -322,7 +322,7 @@ destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) /* Constructor for channel_data */ static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, int is_first, int is_last) { grpc_security_connector *sc = grpc_find_security_connector_in_args (args); /* grab pointers to our data from the channel element */ @@ -346,7 +346,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp /* Destructor for channel data */ static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { /* grab pointers to our data from the channel element */ channel_data *chand = elem->channel_data; diff --git a/src/core/security/credentials.c b/src/core/security/credentials.c index ade70dddbc..caf3d6f885 100644 --- a/src/core/security/credentials.c +++ b/src/core/security/credentials.c @@ -120,7 +120,7 @@ grpc_credentials_has_request_metadata_only (grpc_credentials * creds) } void -grpc_credentials_get_request_metadata (grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data, grpc_closure_list * closure_list) +grpc_credentials_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data) { if (creds == NULL || !grpc_credentials_has_request_metadata (creds) || creds->vtable->get_request_metadata == NULL) { @@ -420,7 +420,7 @@ jwt_has_request_metadata_only (const grpc_credentials * creds) } static void -jwt_get_request_metadata (grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data, grpc_closure_list * closure_list) +jwt_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data) { grpc_service_account_jwt_access_credentials *c = (grpc_service_account_jwt_access_credentials *) creds; gpr_timespec refresh_threshold = gpr_time_from_seconds (GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS, GPR_TIMESPAN); @@ -632,7 +632,7 @@ end: } static void -on_oauth2_token_fetcher_http_response (void *user_data, const grpc_httpcli_response * response, grpc_closure_list * closure_list) +on_oauth2_token_fetcher_http_response (grpc_exec_ctx * exec_ctx, void *user_data, const grpc_httpcli_response * response) { grpc_credentials_metadata_request *r = (grpc_credentials_metadata_request *) user_data; grpc_oauth2_token_fetcher_credentials *c = (grpc_oauth2_token_fetcher_credentials *) r->creds; @@ -656,7 +656,7 @@ on_oauth2_token_fetcher_http_response (void *user_data, const grpc_httpcli_respo } static void -oauth2_token_fetcher_get_request_metadata (grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data, grpc_closure_list * closure_list) +oauth2_token_fetcher_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data) { grpc_oauth2_token_fetcher_credentials *c = (grpc_oauth2_token_fetcher_credentials *) creds; gpr_timespec refresh_threshold = gpr_time_from_seconds (GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS, GPR_TIMESPAN); @@ -701,7 +701,7 @@ static grpc_credentials_vtable compute_engine_vtable = { }; static void -compute_engine_fetch_oauth2 (grpc_credentials_metadata_request * metadata_req, grpc_httpcli_context * httpcli_context, grpc_pollset * pollset, grpc_httpcli_response_cb response_cb, gpr_timespec deadline, grpc_closure_list * closure_list) +compute_engine_fetch_oauth2 (grpc_exec_ctx * exec_ctx, grpc_credentials_metadata_request * metadata_req, grpc_httpcli_context * httpcli_context, grpc_pollset * pollset, grpc_httpcli_response_cb response_cb, gpr_timespec deadline) { grpc_httpcli_header header = { "Metadata-Flavor", "Google" }; grpc_httpcli_request request; @@ -740,7 +740,7 @@ static grpc_credentials_vtable refresh_token_vtable = { }; static void -refresh_token_fetch_oauth2 (grpc_credentials_metadata_request * metadata_req, grpc_httpcli_context * httpcli_context, grpc_pollset * pollset, grpc_httpcli_response_cb response_cb, gpr_timespec deadline, grpc_closure_list * closure_list) +refresh_token_fetch_oauth2 (grpc_exec_ctx * exec_ctx, grpc_credentials_metadata_request * metadata_req, grpc_httpcli_context * httpcli_context, grpc_pollset * pollset, grpc_httpcli_response_cb response_cb, gpr_timespec deadline) { grpc_google_refresh_token_credentials *c = (grpc_google_refresh_token_credentials *) metadata_req->creds; grpc_httpcli_header header = { "Content-Type", @@ -816,7 +816,7 @@ on_simulated_token_fetch_done (void *user_data) } static void -md_only_test_get_request_metadata (grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data, grpc_closure_list * closure_list) +md_only_test_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data) { grpc_md_only_test_credentials *c = (grpc_md_only_test_credentials *) creds; @@ -874,7 +874,7 @@ access_token_has_request_metadata_only (const grpc_credentials * creds) } static void -access_token_get_request_metadata (grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data, grpc_closure_list * closure_list) +access_token_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data) { grpc_access_token_credentials *c = (grpc_access_token_credentials *) creds; cb (user_data, c->access_token_md->entries, 1, GRPC_CREDENTIALS_OK, closure_list); @@ -1042,7 +1042,7 @@ composite_md_context_destroy (grpc_composite_credentials_metadata_context * ctx) } static void -composite_metadata_cb (void *user_data, grpc_credentials_md * md_elems, size_t num_md, grpc_credentials_status status, grpc_closure_list * closure_list) +composite_metadata_cb (grpc_exec_ctx * exec_ctx, void *user_data, grpc_credentials_md * md_elems, size_t num_md, grpc_credentials_status status) { grpc_composite_credentials_metadata_context *ctx = (grpc_composite_credentials_metadata_context *) user_data; if (status != GRPC_CREDENTIALS_OK) @@ -1079,7 +1079,7 @@ composite_metadata_cb (void *user_data, grpc_credentials_md * md_elems, size_t n } static void -composite_get_request_metadata (grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data, grpc_closure_list * closure_list) +composite_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data) { grpc_composite_credentials *c = (grpc_composite_credentials *) creds; grpc_composite_credentials_metadata_context *ctx; @@ -1259,7 +1259,7 @@ iam_has_request_metadata_only (const grpc_credentials * creds) } static void -iam_get_request_metadata (grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data, grpc_closure_list * closure_list) +iam_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data) { grpc_google_iam_credentials *c = (grpc_google_iam_credentials *) creds; cb (user_data, c->iam_md->entries, c->iam_md->num_entries, GRPC_CREDENTIALS_OK, closure_list); @@ -1360,7 +1360,7 @@ plugin_md_request_metadata_ready (void *request, const grpc_metadata * md, size_ } static void -plugin_get_request_metadata (grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data, grpc_closure_list * closure_list) +plugin_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data) { grpc_plugin_credentials *c = (grpc_plugin_credentials *) creds; if (c->plugin.get_metadata != NULL) diff --git a/src/core/security/credentials.h b/src/core/security/credentials.h index 2de67e40c8..c10c9db626 100644 --- a/src/core/security/credentials.h +++ b/src/core/security/credentials.h @@ -122,14 +122,14 @@ grpc_server_credentials *grpc_fake_transport_security_server_credentials_create /* It is the caller's responsibility to gpr_free the result if not NULL. */ char *grpc_get_well_known_google_credentials_file_path (void); -typedef void (*grpc_credentials_metadata_cb) (void *user_data, grpc_credentials_md * md_elems, size_t num_md, grpc_credentials_status status, grpc_closure_list * closure_list); +typedef void (*grpc_credentials_metadata_cb) (grpc_exec_ctx * exec_ctx, void *user_data, grpc_credentials_md * md_elems, size_t num_md, grpc_credentials_status status); typedef struct { void (*destruct) (grpc_credentials * c); int (*has_request_metadata) (const grpc_credentials * c); int (*has_request_metadata_only) (const grpc_credentials * c); - void (*get_request_metadata) (grpc_credentials * c, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data, grpc_closure_list * closure_list); + void (*get_request_metadata) (grpc_exec_ctx * exec_ctx, grpc_credentials * c, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data); grpc_security_status (*create_security_connector) (grpc_credentials * c, const char *target, const grpc_channel_args * args, grpc_credentials * request_metadata_creds, grpc_channel_security_connector ** sc, grpc_channel_args ** new_args); } grpc_credentials_vtable; @@ -144,7 +144,7 @@ grpc_credentials *grpc_credentials_ref (grpc_credentials * creds); void grpc_credentials_unref (grpc_credentials * creds); int grpc_credentials_has_request_metadata (grpc_credentials * creds); int grpc_credentials_has_request_metadata_only (grpc_credentials * creds); -void grpc_credentials_get_request_metadata (grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data, grpc_closure_list * closure_list); +void grpc_credentials_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data); /* Creates a security connector for the channel. May also create new channel args for the channel to be used in place of the passed in const args if @@ -246,7 +246,7 @@ typedef struct typedef struct grpc_credentials_metadata_request grpc_credentials_metadata_request; -typedef void (*grpc_fetch_oauth2_func) (grpc_credentials_metadata_request * req, grpc_httpcli_context * http_context, grpc_pollset * pollset, grpc_httpcli_response_cb response_cb, gpr_timespec deadline, grpc_closure_list * closure_list); +typedef void (*grpc_fetch_oauth2_func) (grpc_exec_ctx * exec_ctx, grpc_credentials_metadata_request * req, grpc_httpcli_context * http_context, grpc_pollset * pollset, grpc_httpcli_response_cb response_cb, gpr_timespec deadline); typedef struct { diff --git a/src/core/security/google_default_credentials.c b/src/core/security/google_default_credentials.c index 308f9a39f6..527f7ea999 100644 --- a/src/core/security/google_default_credentials.c +++ b/src/core/security/google_default_credentials.c @@ -68,7 +68,7 @@ typedef struct } compute_engine_detector; static void -on_compute_engine_detection_http_response (void *user_data, const grpc_httpcli_response * response, grpc_closure_list * closure_list) +on_compute_engine_detection_http_response (grpc_exec_ctx * exec_ctx, void *user_data, const grpc_httpcli_response * response) { compute_engine_detector *detector = (compute_engine_detector *) user_data; if (response != NULL && response->status == 200 && response->hdr_count > 0) @@ -93,7 +93,7 @@ on_compute_engine_detection_http_response (void *user_data, const grpc_httpcli_r } static void -destroy_pollset (void *p, int s, grpc_closure_list * closure_list) +destroy_pollset (grpc_exec_ctx * exec_ctx, void *p, int s) { grpc_pollset_destroy (p); } diff --git a/src/core/security/handshake.c b/src/core/security/handshake.c index 85f84ac963..7951f34943 100644 --- a/src/core/security/handshake.c +++ b/src/core/security/handshake.c @@ -59,12 +59,12 @@ typedef struct grpc_closure on_handshake_data_received_from_peer; } grpc_security_handshake; -static void on_handshake_data_received_from_peer (void *setup, int success, grpc_closure_list * closure_list); +static void on_handshake_data_received_from_peer (grpc_exec_ctx * exec_ctx, void *setup, int success); -static void on_handshake_data_sent_to_peer (void *setup, int success, grpc_closure_list * closure_list); +static void on_handshake_data_sent_to_peer (grpc_exec_ctx * exec_ctx, void *setup, int success); static void -security_handshake_done (grpc_security_handshake * h, int is_success, grpc_closure_list * closure_list) +security_handshake_done (grpc_exec_ctx * exec_ctx, grpc_security_handshake * h, int is_success) { if (is_success) { @@ -95,7 +95,7 @@ security_handshake_done (grpc_security_handshake * h, int is_success, grpc_closu } static void -on_peer_checked (void *user_data, grpc_security_status status, grpc_closure_list * closure_list) +on_peer_checked (grpc_exec_ctx * exec_ctx, void *user_data, grpc_security_status status) { grpc_security_handshake *h = user_data; tsi_frame_protector *protector; @@ -121,7 +121,7 @@ on_peer_checked (void *user_data, grpc_security_status status, grpc_closure_list } static void -check_peer (grpc_security_handshake * h, grpc_closure_list * closure_list) +check_peer (grpc_exec_ctx * exec_ctx, grpc_security_handshake * h) { grpc_security_status peer_status; tsi_peer peer; @@ -147,7 +147,7 @@ check_peer (grpc_security_handshake * h, grpc_closure_list * closure_list) } static void -send_handshake_bytes_to_peer (grpc_security_handshake * h, grpc_closure_list * closure_list) +send_handshake_bytes_to_peer (grpc_exec_ctx * exec_ctx, grpc_security_handshake * h) { size_t offset = 0; tsi_result result = TSI_OK; @@ -182,7 +182,7 @@ send_handshake_bytes_to_peer (grpc_security_handshake * h, grpc_closure_list * c } static void -on_handshake_data_received_from_peer (void *handshake, int success, grpc_closure_list * closure_list) +on_handshake_data_received_from_peer (grpc_exec_ctx * exec_ctx, void *handshake, int success) { grpc_security_handshake *h = handshake; size_t consumed_slice_size = 0; @@ -249,7 +249,7 @@ on_handshake_data_received_from_peer (void *handshake, int success, grpc_closure /* If handshake is NULL, the handshake is done. */ static void -on_handshake_data_sent_to_peer (void *handshake, int success, grpc_closure_list * closure_list) +on_handshake_data_sent_to_peer (grpc_exec_ctx * exec_ctx, void *handshake, int success) { grpc_security_handshake *h = handshake; @@ -276,7 +276,7 @@ on_handshake_data_sent_to_peer (void *handshake, int success, grpc_closure_list } void -grpc_do_security_handshake (tsi_handshaker * handshaker, grpc_security_connector * connector, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list) +grpc_do_security_handshake (grpc_exec_ctx * exec_ctx, tsi_handshaker * handshaker, grpc_security_connector * connector, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data) { grpc_security_handshake *h = gpr_malloc (sizeof (grpc_security_handshake)); memset (h, 0, sizeof (grpc_security_handshake)); diff --git a/src/core/security/handshake.h b/src/core/security/handshake.h index 4d518e7edf..84798e96ec 100644 --- a/src/core/security/handshake.h +++ b/src/core/security/handshake.h @@ -38,6 +38,6 @@ #include "src/core/security/security_connector.h" /* Calls the callback upon completion. Takes owership of handshaker. */ -void grpc_do_security_handshake (tsi_handshaker * handshaker, grpc_security_connector * connector, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list); +void grpc_do_security_handshake (grpc_exec_ctx * exec_ctx, tsi_handshaker * handshaker, grpc_security_connector * connector, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data); #endif /* GRPC_INTERNAL_CORE_SECURITY_HANDSHAKE_H */ diff --git a/src/core/security/jwt_verifier.c b/src/core/security/jwt_verifier.c index f7c9c7f4d1..dcc751f143 100644 --- a/src/core/security/jwt_verifier.c +++ b/src/core/security/jwt_verifier.c @@ -692,7 +692,7 @@ end: } static void -on_keys_retrieved (void *user_data, const grpc_httpcli_response * response, grpc_closure_list * closure_list) +on_keys_retrieved (grpc_exec_ctx * exec_ctx, void *user_data, const grpc_httpcli_response * response) { grpc_json *json = json_from_http (response); verifier_cb_ctx *ctx = (verifier_cb_ctx *) user_data; @@ -737,7 +737,7 @@ end: } static void -on_openid_config_retrieved (void *user_data, const grpc_httpcli_response * response, grpc_closure_list * closure_list) +on_openid_config_retrieved (grpc_exec_ctx * exec_ctx, void *user_data, const grpc_httpcli_response * response) { const grpc_json *cur; grpc_json *json = json_from_http (response); @@ -821,7 +821,7 @@ verifier_put_mapping (grpc_jwt_verifier * v, const char *email_domain, const cha /* Takes ownership of ctx. */ static void -retrieve_key_and_verify (verifier_cb_ctx * ctx, grpc_closure_list * closure_list) +retrieve_key_and_verify (grpc_exec_ctx * exec_ctx, verifier_cb_ctx * ctx) { const char *at_sign; grpc_httpcli_response_cb http_cb; @@ -904,7 +904,7 @@ error: } void -grpc_jwt_verifier_verify (grpc_jwt_verifier * verifier, grpc_pollset * pollset, const char *jwt, const char *audience, grpc_jwt_verification_done_cb cb, void *user_data, grpc_closure_list * closure_list) +grpc_jwt_verifier_verify (grpc_exec_ctx * exec_ctx, grpc_jwt_verifier * verifier, grpc_pollset * pollset, const char *jwt, const char *audience, grpc_jwt_verification_done_cb cb, void *user_data) { const char *dot = NULL; grpc_json *json; diff --git a/src/core/security/jwt_verifier.h b/src/core/security/jwt_verifier.h index 4a1748898e..5fc99aafe0 100644 --- a/src/core/security/jwt_verifier.h +++ b/src/core/security/jwt_verifier.h @@ -118,7 +118,7 @@ void grpc_jwt_verifier_destroy (grpc_jwt_verifier * verifier); typedef void (*grpc_jwt_verification_done_cb) (void *user_data, grpc_jwt_verifier_status status, grpc_jwt_claims * claims); /* Verifies for the JWT for the given expected audience. */ -void grpc_jwt_verifier_verify (grpc_jwt_verifier * verifier, grpc_pollset * pollset, const char *jwt, const char *audience, grpc_jwt_verification_done_cb cb, void *user_data, grpc_closure_list * closure_list); +void grpc_jwt_verifier_verify (grpc_exec_ctx * exec_ctx, grpc_jwt_verifier * verifier, grpc_pollset * pollset, const char *jwt, const char *audience, grpc_jwt_verification_done_cb cb, void *user_data); /* --- TESTING ONLY exposed functions. --- */ diff --git a/src/core/security/secure_endpoint.c b/src/core/security/secure_endpoint.c index 64c501860f..966dfbb666 100644 --- a/src/core/security/secure_endpoint.c +++ b/src/core/security/secure_endpoint.c @@ -69,7 +69,7 @@ typedef struct int grpc_trace_secure_endpoint = 0; static void -destroy (secure_endpoint * secure_ep, grpc_closure_list * closure_list) +destroy (grpc_exec_ctx * exec_ctx, secure_endpoint * secure_ep) { secure_endpoint *ep = secure_ep; grpc_endpoint_destroy (ep->wrapped_ep, closure_list); @@ -109,7 +109,7 @@ secure_endpoint_ref (secure_endpoint * ep, const char *reason, const char *file, #define SECURE_ENDPOINT_UNREF(ep, reason, cl) secure_endpoint_unref((ep), (cl)) #define SECURE_ENDPOINT_REF(ep, reason) secure_endpoint_ref((ep)) static void -secure_endpoint_unref (secure_endpoint * ep, grpc_closure_list * closure_list) +secure_endpoint_unref (grpc_exec_ctx * exec_ctx, secure_endpoint * ep) { if (gpr_unref (&ep->ref)) { @@ -134,7 +134,7 @@ flush_read_staging_buffer (secure_endpoint * ep, gpr_uint8 ** cur, gpr_uint8 ** } static void -call_read_cb (secure_endpoint * ep, int success, grpc_closure_list * closure_list) +call_read_cb (grpc_exec_ctx * exec_ctx, secure_endpoint * ep, int success) { if (grpc_trace_secure_endpoint) { @@ -153,7 +153,7 @@ call_read_cb (secure_endpoint * ep, int success, grpc_closure_list * closure_lis } static void -on_read (void *user_data, int success, grpc_closure_list * closure_list) +on_read (grpc_exec_ctx * exec_ctx, void *user_data, int success) { unsigned i; gpr_uint8 keep_looping = 0; @@ -234,7 +234,7 @@ on_read (void *user_data, int success, grpc_closure_list * closure_list) } static void -endpoint_read (grpc_endpoint * secure_ep, gpr_slice_buffer * slices, grpc_closure * cb, grpc_closure_list * closure_list) +endpoint_read (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep, gpr_slice_buffer * slices, grpc_closure * cb) { secure_endpoint *ep = (secure_endpoint *) secure_ep; ep->read_cb = cb; @@ -263,7 +263,7 @@ flush_write_staging_buffer (secure_endpoint * ep, gpr_uint8 ** cur, gpr_uint8 ** } static void -endpoint_write (grpc_endpoint * secure_ep, gpr_slice_buffer * slices, grpc_closure * cb, grpc_closure_list * closure_list) +endpoint_write (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep, gpr_slice_buffer * slices, grpc_closure * cb) { unsigned i; tsi_result result = TSI_OK; @@ -348,28 +348,28 @@ endpoint_write (grpc_endpoint * secure_ep, gpr_slice_buffer * slices, grpc_closu } static void -endpoint_shutdown (grpc_endpoint * secure_ep, grpc_closure_list * closure_list) +endpoint_shutdown (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep) { secure_endpoint *ep = (secure_endpoint *) secure_ep; grpc_endpoint_shutdown (ep->wrapped_ep, closure_list); } static void -endpoint_destroy (grpc_endpoint * secure_ep, grpc_closure_list * closure_list) +endpoint_destroy (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep) { secure_endpoint *ep = (secure_endpoint *) secure_ep; SECURE_ENDPOINT_UNREF (ep, "destroy", closure_list); } static void -endpoint_add_to_pollset (grpc_endpoint * secure_ep, grpc_pollset * pollset, grpc_closure_list * closure_list) +endpoint_add_to_pollset (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep, grpc_pollset * pollset) { secure_endpoint *ep = (secure_endpoint *) secure_ep; grpc_endpoint_add_to_pollset (ep->wrapped_ep, pollset, closure_list); } static void -endpoint_add_to_pollset_set (grpc_endpoint * secure_ep, grpc_pollset_set * pollset_set, grpc_closure_list * closure_list) +endpoint_add_to_pollset_set (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep, grpc_pollset_set * pollset_set) { secure_endpoint *ep = (secure_endpoint *) secure_ep; grpc_endpoint_add_to_pollset_set (ep->wrapped_ep, pollset_set, closure_list); diff --git a/src/core/security/security_connector.c b/src/core/security/security_connector.c index 694004e4e0..91462c52cd 100644 --- a/src/core/security/security_connector.c +++ b/src/core/security/security_connector.c @@ -110,7 +110,7 @@ tsi_peer_get_property_by_name (const tsi_peer * peer, const char *name) } void -grpc_security_connector_do_handshake (grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list) +grpc_security_connector_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data) { if (sc == NULL || nonsecure_endpoint == NULL) { @@ -134,7 +134,7 @@ grpc_security_connector_check_peer (grpc_security_connector * sc, tsi_peer peer, } grpc_security_status -grpc_channel_security_connector_check_call_host (grpc_channel_security_connector * sc, const char *host, grpc_security_check_cb cb, void *user_data, grpc_closure_list * closure_list) +grpc_channel_security_connector_check_call_host (grpc_exec_ctx * exec_ctx, grpc_channel_security_connector * sc, const char *host, grpc_security_check_cb cb, void *user_data) { if (sc == NULL || sc->check_call_host == NULL) return GRPC_SECURITY_ERROR; @@ -298,7 +298,7 @@ end: } static grpc_security_status -fake_channel_check_call_host (grpc_channel_security_connector * sc, const char *host, grpc_security_check_cb cb, void *user_data, grpc_closure_list * closure_list) +fake_channel_check_call_host (grpc_exec_ctx * exec_ctx, grpc_channel_security_connector * sc, const char *host, grpc_security_check_cb cb, void *user_data) { grpc_fake_channel_security_connector *c = (grpc_fake_channel_security_connector *) sc; if (c->call_host_check_is_async) @@ -313,13 +313,13 @@ fake_channel_check_call_host (grpc_channel_security_connector * sc, const char * } static void -fake_channel_do_handshake (grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list) +fake_channel_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data) { grpc_do_security_handshake (tsi_create_fake_handshaker (1), sc, nonsecure_endpoint, cb, user_data, closure_list); } static void -fake_server_do_handshake (grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list) +fake_server_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data) { grpc_do_security_handshake (tsi_create_fake_handshaker (0), sc, nonsecure_endpoint, cb, user_data, closure_list); } @@ -423,7 +423,7 @@ ssl_create_handshaker (tsi_ssl_handshaker_factory * handshaker_factory, int is_c } static void -ssl_channel_do_handshake (grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list) +ssl_channel_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data) { grpc_ssl_channel_security_connector *c = (grpc_ssl_channel_security_connector *) sc; tsi_handshaker *handshaker; @@ -441,7 +441,7 @@ ssl_channel_do_handshake (grpc_security_connector * sc, grpc_endpoint * nonsecur } static void -ssl_server_do_handshake (grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list) +ssl_server_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data) { grpc_ssl_server_security_connector *c = (grpc_ssl_server_security_connector *) sc; tsi_handshaker *handshaker; @@ -564,7 +564,7 @@ ssl_server_check_peer (grpc_security_connector * sc, tsi_peer peer, grpc_securit } static grpc_security_status -ssl_channel_check_call_host (grpc_channel_security_connector * sc, const char *host, grpc_security_check_cb cb, void *user_data, grpc_closure_list * closure_list) +ssl_channel_check_call_host (grpc_exec_ctx * exec_ctx, grpc_channel_security_connector * sc, const char *host, grpc_security_check_cb cb, void *user_data) { grpc_ssl_channel_security_connector *c = (grpc_ssl_channel_security_connector *) sc; diff --git a/src/core/security/security_connector.h b/src/core/security/security_connector.h index 913e01978d..3af7f6f83a 100644 --- a/src/core/security/security_connector.h +++ b/src/core/security/security_connector.h @@ -61,15 +61,15 @@ typedef struct grpc_security_connector grpc_security_connector; #define GRPC_SECURITY_CONNECTOR_ARG "grpc.security_connector" -typedef void (*grpc_security_check_cb) (void *user_data, grpc_security_status status, grpc_closure_list * closure_list); +typedef void (*grpc_security_check_cb) (grpc_exec_ctx * exec_ctx, void *user_data, grpc_security_status status); /* Ownership of the secure_endpoint is transfered. */ -typedef void (*grpc_security_handshake_done_cb) (void *user_data, grpc_security_status status, grpc_endpoint * wrapped_endpoint, grpc_endpoint * secure_endpoint, grpc_closure_list * closure_list); +typedef void (*grpc_security_handshake_done_cb) (grpc_exec_ctx * exec_ctx, void *user_data, grpc_security_status status, grpc_endpoint * wrapped_endpoint, grpc_endpoint * secure_endpoint); typedef struct { void (*destroy) (grpc_security_connector * sc); - void (*do_handshake) (grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list); + void (*do_handshake) (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data); grpc_security_status (*check_peer) (grpc_security_connector * sc, tsi_peer peer, grpc_security_check_cb cb, void *user_data); } grpc_security_connector_vtable; @@ -98,7 +98,7 @@ void grpc_security_connector_unref (grpc_security_connector * policy); #endif /* Handshake. */ -void grpc_security_connector_do_handshake (grpc_security_connector * connector, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data, grpc_closure_list * closure_list); +void grpc_security_connector_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * connector, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data); /* Check the peer. Implementations can choose to check the peer either synchronously or @@ -129,7 +129,7 @@ struct grpc_channel_security_connector { grpc_security_connector base; /* requires is_client_side to be non 0. */ grpc_credentials *request_metadata_creds; - grpc_security_status (*check_call_host) (grpc_channel_security_connector * sc, const char *host, grpc_security_check_cb cb, void *user_data, grpc_closure_list * closure_list); + grpc_security_status (*check_call_host) (grpc_exec_ctx * exec_ctx, grpc_channel_security_connector * sc, const char *host, grpc_security_check_cb cb, void *user_data); }; /* Checks that the host that will be set for a call is acceptable. @@ -137,7 +137,7 @@ struct grpc_channel_security_connector asynchronously. In the first case, a successful call will return GRPC_SECURITY_OK. In the asynchronous case, the call will return GRPC_SECURITY_PENDING unless an error is detected early on. */ -grpc_security_status grpc_channel_security_connector_check_call_host (grpc_channel_security_connector * sc, const char *host, grpc_security_check_cb cb, void *user_data, grpc_closure_list * closure_list); +grpc_security_status grpc_channel_security_connector_check_call_host (grpc_exec_ctx * exec_ctx, grpc_channel_security_connector * sc, const char *host, grpc_security_check_cb cb, void *user_data); /* --- Creation security connectors. --- */ diff --git a/src/core/security/server_auth_filter.c b/src/core/security/server_auth_filter.c index 66316f788e..86a5f9cb3e 100644 --- a/src/core/security/server_auth_filter.c +++ b/src/core/security/server_auth_filter.c @@ -151,7 +151,7 @@ on_md_processing_done (void *user_data, const grpc_metadata * consumed_md, size_ } static void -auth_on_recv (void *user_data, int success, grpc_closure_list * closure_list) +auth_on_recv (grpc_exec_ctx * exec_ctx, void *user_data, int success) { grpc_call_element *elem = user_data; call_data *calld = elem->call_data; @@ -199,7 +199,7 @@ set_recv_ops_md_callbacks (grpc_call_element * elem, grpc_transport_stream_op * op contains type and call direction information, in addition to the data that is being sent or received. */ static void -auth_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +auth_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { set_recv_ops_md_callbacks (elem, op); grpc_call_next_op (elem, op, closure_list); @@ -207,7 +207,7 @@ auth_start_transport_op (grpc_call_element * elem, grpc_transport_stream_op * op /* Constructor for call_data */ static void -init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { /* grab pointers to our data from the call element */ call_data *calld = elem->call_data; @@ -239,13 +239,13 @@ init_call_elem (grpc_call_element * elem, const void *server_transport_data, grp /* Destructor for call_data */ static void -destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { } /* Constructor for channel_data */ static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last) { grpc_security_connector *sc = grpc_find_security_connector_in_args (args); grpc_auth_metadata_processor *processor = grpc_find_auth_metadata_processor_in_args (args); @@ -269,7 +269,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp /* Destructor for channel data */ static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { /* grab pointers to our data from the channel element */ channel_data *chand = elem->channel_data; diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c index 42c4b63868..b11cf1079a 100644 --- a/src/core/security/server_secure_chttp2.c +++ b/src/core/security/server_secure_chttp2.c @@ -93,7 +93,7 @@ state_unref (grpc_server_secure_state * state) } static void -setup_transport (void *statep, grpc_transport * transport, grpc_mdctx * mdctx, grpc_closure_list * closure_list) +setup_transport (grpc_exec_ctx * exec_ctx, void *statep, grpc_transport * transport, grpc_mdctx * mdctx) { static grpc_channel_filter const *extra_filters[] = { &grpc_server_auth_filter, &grpc_http_server_filter @@ -134,7 +134,7 @@ remove_tcp_from_list_locked (grpc_server_secure_state * state, grpc_endpoint * t } static void -on_secure_handshake_done (void *statep, grpc_security_status status, grpc_endpoint * wrapped_endpoint, grpc_endpoint * secure_endpoint, grpc_closure_list * closure_list) +on_secure_handshake_done (grpc_exec_ctx * exec_ctx, void *statep, grpc_security_status status, grpc_endpoint * wrapped_endpoint, grpc_endpoint * secure_endpoint) { grpc_server_secure_state *state = statep; grpc_transport *transport; @@ -169,7 +169,7 @@ on_secure_handshake_done (void *statep, grpc_security_status status, grpc_endpoi } static void -on_accept (void *statep, grpc_endpoint * tcp, grpc_closure_list * closure_list) +on_accept (grpc_exec_ctx * exec_ctx, void *statep, grpc_endpoint * tcp) { grpc_server_secure_state *state = statep; tcp_endpoint_list *node; @@ -185,14 +185,14 @@ on_accept (void *statep, grpc_endpoint * tcp, grpc_closure_list * closure_list) /* Server callback: start listening on our ports */ static void -start (grpc_server * server, void *statep, grpc_pollset ** pollsets, size_t pollset_count, grpc_closure_list * closure_list) +start (grpc_exec_ctx * exec_ctx, grpc_server * server, void *statep, grpc_pollset ** pollsets, size_t pollset_count) { grpc_server_secure_state *state = statep; grpc_tcp_server_start (state->tcp, pollsets, pollset_count, on_accept, state, closure_list); } static void -destroy_done (void *statep, int success, grpc_closure_list * closure_list) +destroy_done (grpc_exec_ctx * exec_ctx, void *statep, int success) { grpc_server_secure_state *state = statep; state->destroy_callback->cb (state->destroy_callback->cb_arg, success, closure_list); @@ -209,7 +209,7 @@ destroy_done (void *statep, int success, grpc_closure_list * closure_list) /* Server callback: destroy the tcp listener (so we don't generate further callbacks) */ static void -destroy (grpc_server * server, void *statep, grpc_closure * callback, grpc_closure_list * closure_list) +destroy (grpc_exec_ctx * exec_ctx, grpc_server * server, void *statep, grpc_closure * callback) { grpc_server_secure_state *state = statep; grpc_tcp_server *tcp; diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 5a76245a65..5360abdfa9 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -283,18 +283,18 @@ struct grpc_call #define CALL_FROM_TOP_ELEM(top_elem) \ CALL_FROM_CALL_STACK(grpc_call_stack_from_top_element(top_elem)) -static void set_deadline_alarm (grpc_call * call, gpr_timespec deadline, grpc_closure_list * closure_list); -static void call_on_done_recv (void *call, int success, grpc_closure_list * closure_list); -static void call_on_done_send (void *call, int success, grpc_closure_list * closure_list); +static void set_deadline_alarm (grpc_exec_ctx * exec_ctx, grpc_call * call, gpr_timespec deadline); +static void call_on_done_recv (grpc_exec_ctx * exec_ctx, void *call, int success); +static void call_on_done_send (grpc_exec_ctx * exec_ctx, void *call, int success); static int fill_send_ops (grpc_call * call, grpc_transport_stream_op * op); -static void execute_op (grpc_call * call, grpc_transport_stream_op * op, grpc_closure_list * closure_list); -static void recv_metadata (grpc_call * call, grpc_metadata_batch * metadata, grpc_closure_list * closure_list); +static void execute_op (grpc_exec_ctx * exec_ctx, grpc_call * call, grpc_transport_stream_op * op); +static void recv_metadata (grpc_exec_ctx * exec_ctx, grpc_call * call, grpc_metadata_batch * metadata); static void finish_read_ops (grpc_call * call); static grpc_call_error cancel_with_status (grpc_call * c, grpc_status_code status, const char *description); -static void finished_loose_op (void *call, int success, grpc_closure_list * closure_list); +static void finished_loose_op (grpc_exec_ctx * exec_ctx, void *call, int success); static void lock (grpc_call * call); -static void unlock (grpc_call * call, grpc_closure_list * closure_list); +static void unlock (grpc_exec_ctx * exec_ctx, grpc_call * call); grpc_call * grpc_call_create (grpc_channel * channel, grpc_call * parent_call, gpr_uint32 propagation_mask, grpc_completion_queue * cq, const void *server_transport_data, grpc_mdelem ** add_initial_metadata, size_t add_initial_metadata_count, gpr_timespec send_deadline) @@ -409,7 +409,7 @@ grpc_call_create (grpc_channel * channel, grpc_call * parent_call, gpr_uint32 pr } void -grpc_call_set_completion_queue (grpc_call * call, grpc_completion_queue * cq, grpc_closure_list * closure_list) +grpc_call_set_completion_queue (grpc_exec_ctx * exec_ctx, grpc_call * call, grpc_completion_queue * cq) { lock (call); call->cq = cq; @@ -446,7 +446,7 @@ allocate_completion (grpc_call * call) } static void -done_completion (void *call, grpc_cq_completion * completion, grpc_closure_list * closure_list) +done_completion (grpc_exec_ctx * exec_ctx, void *call, grpc_cq_completion * completion) { grpc_call *c = call; gpr_mu_lock (&c->completion_mu); @@ -469,7 +469,7 @@ grpc_call_internal_ref (grpc_call * c) } static void -destroy_call (grpc_call * call, grpc_closure_list * closure_list) +destroy_call (grpc_exec_ctx * exec_ctx, grpc_call * call) { size_t i; grpc_call *c = call; @@ -517,12 +517,12 @@ destroy_call (grpc_call * call, grpc_closure_list * closure_list) #ifdef GRPC_CALL_REF_COUNT_DEBUG void -grpc_call_internal_unref (grpc_call * c, const char *reason, grpc_closure_list * closure_list) +grpc_call_internal_unref (grpc_exec_ctx * exec_ctx, grpc_call * c, const char *reason) { gpr_log (GPR_DEBUG, "CALL: unref %p %d -> %d [%s]", c, c->internal_refcount.count, c->internal_refcount.count - 1, reason); #else void -grpc_call_internal_unref (grpc_call * c, grpc_closure_list * closure_list) +grpc_call_internal_unref (grpc_exec_ctx * exec_ctx, grpc_call * c) { #endif if (gpr_unref (&c->internal_refcount)) @@ -638,7 +638,7 @@ need_more_data (grpc_call * call) } static void -unlock (grpc_call * call, grpc_closure_list * closure_list) +unlock (grpc_exec_ctx * exec_ctx, grpc_call * call) { grpc_transport_stream_op op; completed_request completed_requests[GRPC_IOREQ_OP_COUNT]; @@ -889,7 +889,7 @@ early_out_write_ops (grpc_call * call) } static void -call_on_done_send (void *pc, int success, grpc_closure_list * closure_list) +call_on_done_send (grpc_exec_ctx * exec_ctx, void *pc, int success) { grpc_call *call = pc; lock (call); @@ -1036,7 +1036,7 @@ add_slice_to_message (grpc_call * call, gpr_slice slice) } static void -call_on_done_recv (void *pc, int success, grpc_closure_list * closure_list) +call_on_done_recv (grpc_exec_ctx * exec_ctx, void *pc, int success) { grpc_call *call = pc; grpc_call *child_call; @@ -1381,7 +1381,7 @@ start_ioreq (grpc_call * call, const grpc_ioreq * reqs, size_t nreqs, grpc_ioreq } grpc_call_error -grpc_call_start_ioreq_and_call_back (grpc_call * call, const grpc_ioreq * reqs, size_t nreqs, grpc_ioreq_completion_func on_complete, void *user_data, grpc_closure_list * closure_list) +grpc_call_start_ioreq_and_call_back (grpc_exec_ctx * exec_ctx, grpc_call * call, const grpc_ioreq * reqs, size_t nreqs, grpc_ioreq_completion_func on_complete, void *user_data) { grpc_call_error err; lock (call); @@ -1465,7 +1465,7 @@ cancel_with_status (grpc_call * c, grpc_status_code status, const char *descript } static void -finished_loose_op (void *call, int success_ignored, grpc_closure_list * closure_list) +finished_loose_op (grpc_exec_ctx * exec_ctx, void *call, int success_ignored) { GRPC_CALL_INTERNAL_UNREF (call, "loose-op", closure_list); } @@ -1477,7 +1477,7 @@ typedef struct } finished_loose_op_allocated_args; static void -finished_loose_op_allocated (void *alloc, int success, grpc_closure_list * closure_list) +finished_loose_op_allocated (grpc_exec_ctx * exec_ctx, void *alloc, int success) { finished_loose_op_allocated_args *args = alloc; finished_loose_op (args->call, success, closure_list); @@ -1485,7 +1485,7 @@ finished_loose_op_allocated (void *alloc, int success, grpc_closure_list * closu } static void -execute_op (grpc_call * call, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +execute_op (grpc_exec_ctx * exec_ctx, grpc_call * call, grpc_transport_stream_op * op) { grpc_call_element *elem; @@ -1528,7 +1528,7 @@ grpc_call_from_top_element (grpc_call_element * elem) } static void -call_alarm (void *arg, int success, grpc_closure_list * closure_list) +call_alarm (grpc_exec_ctx * exec_ctx, void *arg, int success) { grpc_call *call = arg; lock (call); @@ -1543,7 +1543,7 @@ call_alarm (void *arg, int success, grpc_closure_list * closure_list) } static void -set_deadline_alarm (grpc_call * call, gpr_timespec deadline, grpc_closure_list * closure_list) +set_deadline_alarm (grpc_exec_ctx * exec_ctx, grpc_call * call, gpr_timespec deadline) { if (call->have_alarm) { @@ -1617,7 +1617,7 @@ decode_compression (grpc_mdelem * md) } static void -recv_metadata (grpc_call * call, grpc_metadata_batch * md, grpc_closure_list * closure_list) +recv_metadata (grpc_exec_ctx * exec_ctx, grpc_call * call, grpc_metadata_batch * md) { grpc_linked_mdelem *l; grpc_metadata_array *dest; @@ -1712,13 +1712,13 @@ set_cancelled_value (grpc_status_code status, void *dest) } static void -finish_batch (grpc_call * call, int success, void *tag, grpc_closure_list * closure_list) +finish_batch (grpc_exec_ctx * exec_ctx, grpc_call * call, int success, void *tag) { grpc_cq_end_op (call->cq, tag, success, done_completion, call, allocate_completion (call), closure_list); } static void -finish_batch_with_close (grpc_call * call, int success, void *tag, grpc_closure_list * closure_list) +finish_batch_with_close (grpc_exec_ctx * exec_ctx, grpc_call * call, int success, void *tag) { grpc_cq_end_op (call->cq, tag, 1, done_completion, call, allocate_completion (call), closure_list); } diff --git a/src/core/surface/call.h b/src/core/surface/call.h index a859fbf218..29a3e11354 100644 --- a/src/core/surface/call.h +++ b/src/core/surface/call.h @@ -95,29 +95,29 @@ extern "C" grpc_ioreq_data data; } grpc_ioreq; - typedef void (*grpc_ioreq_completion_func) (grpc_call * call, int success, void *user_data, grpc_closure_list * closure_list); + typedef void (*grpc_ioreq_completion_func) (grpc_exec_ctx * exec_ctx, grpc_call * call, int success, void *user_data); grpc_call *grpc_call_create (grpc_channel * channel, grpc_call * parent_call, gpr_uint32 propagation_mask, grpc_completion_queue * cq, const void *server_transport_data, grpc_mdelem ** add_initial_metadata, size_t add_initial_metadata_count, gpr_timespec send_deadline); - void grpc_call_set_completion_queue (grpc_call * call, grpc_completion_queue * cq, grpc_closure_list * closure_list); + void grpc_call_set_completion_queue (grpc_exec_ctx * exec_ctx, grpc_call * call, grpc_completion_queue * cq); grpc_completion_queue *grpc_call_get_completion_queue (grpc_call * call); #ifdef GRPC_CALL_REF_COUNT_DEBUG void grpc_call_internal_ref (grpc_call * call, const char *reason); - void grpc_call_internal_unref (grpc_call * call, const char *reason, grpc_closure_list * closure_list); + void grpc_call_internal_unref (grpc_exec_ctx * exec_ctx, grpc_call * call, const char *reason); #define GRPC_CALL_INTERNAL_REF(call, reason) \ grpc_call_internal_ref(call, reason) #define GRPC_CALL_INTERNAL_UNREF(call, reason, closure_list) \ grpc_call_internal_unref(call, reason, closure_list) #else void grpc_call_internal_ref (grpc_call * call); - void grpc_call_internal_unref (grpc_call * call, grpc_closure_list * closure_list); + void grpc_call_internal_unref (grpc_exec_ctx * exec_ctx, grpc_call * call); #define GRPC_CALL_INTERNAL_REF(call, reason) grpc_call_internal_ref(call) #define GRPC_CALL_INTERNAL_UNREF(call, reason, closure_list) \ grpc_call_internal_unref(call, closure_list) #endif - grpc_call_error grpc_call_start_ioreq_and_call_back (grpc_call * call, const grpc_ioreq * reqs, size_t nreqs, grpc_ioreq_completion_func on_complete, void *user_data, grpc_closure_list * closure_list); + grpc_call_error grpc_call_start_ioreq_and_call_back (grpc_exec_ctx * exec_ctx, grpc_call * call, const grpc_ioreq * reqs, size_t nreqs, grpc_ioreq_completion_func on_complete, void *user_data); grpc_call_stack *grpc_call_get_call_stack (grpc_call * call); diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c index 440b6494f1..82a463dd75 100644 --- a/src/core/surface/channel.c +++ b/src/core/surface/channel.c @@ -92,7 +92,7 @@ struct grpc_channel #define DEFAULT_MAX_MESSAGE_LENGTH (100 * 1024 * 1024) grpc_channel * -grpc_channel_create_from_filters (const char *target, const grpc_channel_filter ** filters, size_t num_filters, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_client, grpc_closure_list * closure_list) +grpc_channel_create_from_filters (grpc_exec_ctx * exec_ctx, const char *target, const grpc_channel_filter ** filters, size_t num_filters, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_client) { size_t i; size_t size = sizeof (grpc_channel) + grpc_channel_stack_size (filters, num_filters); @@ -262,7 +262,7 @@ grpc_channel_internal_ref (grpc_channel * c) } static void -destroy_channel (grpc_channel * channel, grpc_closure_list * closure_list) +destroy_channel (grpc_exec_ctx * exec_ctx, grpc_channel * channel) { size_t i; grpc_channel_stack_destroy (CHANNEL_STACK_FROM_CHANNEL (channel), closure_list); @@ -299,12 +299,12 @@ destroy_channel (grpc_channel * channel, grpc_closure_list * closure_list) #ifdef GRPC_CHANNEL_REF_COUNT_DEBUG void -grpc_channel_internal_unref (grpc_channel * channel, const char *reason, grpc_closure_list * closure_list) +grpc_channel_internal_unref (grpc_exec_ctx * exec_ctx, grpc_channel * channel, const char *reason) { gpr_log (GPR_DEBUG, "CHANNEL: unref %p %d -> %d [%s]", channel, channel->refs.count, channel->refs.count - 1, reason); #else void -grpc_channel_internal_unref (grpc_channel * channel, grpc_closure_list * closure_list) +grpc_channel_internal_unref (grpc_exec_ctx * exec_ctx, grpc_channel * channel) { #endif if (gpr_unref (&channel->refs)) diff --git a/src/core/surface/channel.h b/src/core/surface/channel.h index 91a038892e..982986e966 100644 --- a/src/core/surface/channel.h +++ b/src/core/surface/channel.h @@ -37,7 +37,7 @@ #include "src/core/channel/channel_stack.h" #include "src/core/client_config/subchannel_factory.h" -grpc_channel *grpc_channel_create_from_filters (const char *target, const grpc_channel_filter ** filters, size_t count, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_client, grpc_closure_list * closure_list); +grpc_channel *grpc_channel_create_from_filters (grpc_exec_ctx * exec_ctx, const char *target, const grpc_channel_filter ** filters, size_t count, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_client); /** Get a (borrowed) pointer to this channels underlying channel stack */ grpc_channel_stack *grpc_channel_get_channel_stack (grpc_channel * channel); @@ -58,14 +58,14 @@ gpr_uint32 grpc_channel_get_max_message_length (grpc_channel * channel); #ifdef GRPC_CHANNEL_REF_COUNT_DEBUG void grpc_channel_internal_ref (grpc_channel * channel, const char *reason); -void grpc_channel_internal_unref (grpc_channel * channel, const char *reason, grpc_closure_list * closure_list); +void grpc_channel_internal_unref (grpc_exec_ctx * exec_ctx, grpc_channel * channel, const char *reason); #define GRPC_CHANNEL_INTERNAL_REF(channel, reason) \ grpc_channel_internal_ref(channel, reason) #define GRPC_CHANNEL_INTERNAL_UNREF(channel, reason, closure_list) \ grpc_channel_internal_unref(channel, reason, closure_list) #else void grpc_channel_internal_ref (grpc_channel * channel); -void grpc_channel_internal_unref (grpc_channel * channel, grpc_closure_list * closure_list); +void grpc_channel_internal_unref (grpc_exec_ctx * exec_ctx, grpc_channel * channel); #define GRPC_CHANNEL_INTERNAL_REF(channel, reason) \ grpc_channel_internal_ref(channel) #define GRPC_CHANNEL_INTERNAL_UNREF(channel, reason, closure_list) \ diff --git a/src/core/surface/channel_connectivity.c b/src/core/surface/channel_connectivity.c index 0a7e8e3837..7c174aa47f 100644 --- a/src/core/surface/channel_connectivity.c +++ b/src/core/surface/channel_connectivity.c @@ -81,7 +81,7 @@ typedef struct } state_watcher; static void -delete_state_watcher (state_watcher * w, grpc_closure_list * closure_list) +delete_state_watcher (grpc_exec_ctx * exec_ctx, state_watcher * w) { GRPC_CHANNEL_INTERNAL_UNREF (w->channel, "watch_connectivity", closure_list); gpr_mu_destroy (&w->mu); @@ -89,7 +89,7 @@ delete_state_watcher (state_watcher * w, grpc_closure_list * closure_list) } static void -finished_completion (void *pw, grpc_cq_completion * ignored, grpc_closure_list * closure_list) +finished_completion (grpc_exec_ctx * exec_ctx, void *pw, grpc_cq_completion * ignored) { int delete = 0; state_watcher *w = pw; @@ -117,7 +117,7 @@ finished_completion (void *pw, grpc_cq_completion * ignored, grpc_closure_list * } static void -partly_done (state_watcher * w, int due_to_completion, grpc_closure_list * closure_list) +partly_done (grpc_exec_ctx * exec_ctx, state_watcher * w, int due_to_completion) { int delete = 0; grpc_channel_element *client_channel_elem = NULL; @@ -165,13 +165,13 @@ partly_done (state_watcher * w, int due_to_completion, grpc_closure_list * closu } static void -watch_complete (void *pw, int success, grpc_closure_list * closure_list) +watch_complete (grpc_exec_ctx * exec_ctx, void *pw, int success) { partly_done (pw, 1, closure_list); } static void -timeout_complete (void *pw, int success, grpc_closure_list * closure_list) +timeout_complete (grpc_exec_ctx * exec_ctx, void *pw, int success) { partly_done (pw, 0, closure_list); } diff --git a/src/core/surface/channel_create.c b/src/core/surface/channel_create.c index c45ebf324f..a8c9f1749f 100644 --- a/src/core/surface/channel_create.c +++ b/src/core/surface/channel_create.c @@ -72,7 +72,7 @@ connector_ref (grpc_connector * con) } static void -connector_unref (grpc_connector * con, grpc_closure_list * closure_list) +connector_unref (grpc_exec_ctx * exec_ctx, grpc_connector * con) { connector *c = (connector *) con; if (gpr_unref (&c->refs)) @@ -83,7 +83,7 @@ connector_unref (grpc_connector * con, grpc_closure_list * closure_list) } static void -connected (void *arg, int success, grpc_closure_list * closure_list) +connected (grpc_exec_ctx * exec_ctx, void *arg, int success) { connector *c = arg; grpc_closure *notify; @@ -107,12 +107,12 @@ connected (void *arg, int success, grpc_closure_list * closure_list) } static void -connector_shutdown (grpc_connector * con, grpc_closure_list * closure_list) +connector_shutdown (grpc_exec_ctx * exec_ctx, grpc_connector * con) { } static void -connector_connect (grpc_connector * con, const grpc_connect_in_args * args, grpc_connect_out_args * result, grpc_closure * notify, grpc_closure_list * closure_list) +connector_connect (grpc_exec_ctx * exec_ctx, grpc_connector * con, const grpc_connect_in_args * args, grpc_connect_out_args * result, grpc_closure * notify) { connector *c = (connector *) con; GPR_ASSERT (c->notify == NULL); @@ -146,7 +146,7 @@ subchannel_factory_ref (grpc_subchannel_factory * scf) } static void -subchannel_factory_unref (grpc_subchannel_factory * scf, grpc_closure_list * closure_list) +subchannel_factory_unref (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * scf) { subchannel_factory *f = (subchannel_factory *) scf; if (gpr_unref (&f->refs)) @@ -159,7 +159,7 @@ subchannel_factory_unref (grpc_subchannel_factory * scf, grpc_closure_list * clo } static grpc_subchannel * -subchannel_factory_create_subchannel (grpc_subchannel_factory * scf, grpc_subchannel_args * args, grpc_closure_list * closure_list) +subchannel_factory_create_subchannel (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * scf, grpc_subchannel_args * args) { subchannel_factory *f = (subchannel_factory *) scf; connector *c = gpr_malloc (sizeof (*c)); diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c index ab9a323c7a..2410ad6fb5 100644 --- a/src/core/surface/completion_queue.c +++ b/src/core/surface/completion_queue.c @@ -72,7 +72,7 @@ struct grpc_completion_queue grpc_closure pollset_destroy_done; }; -static void on_pollset_destroy_done (void *cc, int success, grpc_closure_list * closure_list); +static void on_pollset_destroy_done (grpc_exec_ctx * exec_ctx, void *cc, int success); grpc_completion_queue * grpc_completion_queue_create (void *reserved) @@ -105,7 +105,7 @@ grpc_cq_internal_ref (grpc_completion_queue * cc) } static void -on_pollset_destroy_done (void *arg, int success, grpc_closure_list * closure_list) +on_pollset_destroy_done (grpc_exec_ctx * exec_ctx, void *arg, int success) { grpc_completion_queue *cc = arg; GRPC_CQ_INTERNAL_UNREF (cc, "pollset_destroy"); @@ -144,7 +144,7 @@ grpc_cq_begin_op (grpc_completion_queue * cc) event, then enter shutdown mode */ /* Queue a GRPC_OP_COMPLETED operation */ void -grpc_cq_end_op (grpc_completion_queue * cc, void *tag, int success, void (*done) (void *done_arg, grpc_cq_completion * storage, grpc_closure_list * closure_list), void *done_arg, grpc_cq_completion * storage, grpc_closure_list * closure_list) +grpc_cq_end_op (grpc_completion_queue * cc, void *tag, int success, void (*done) (grpc_exec_ctx * exec_ctx, void *done_arg, grpc_cq_completion * storage, grpc_closure_list * closure_list), void *done_arg, grpc_cq_completion * storage) { int shutdown; int i; diff --git a/src/core/surface/completion_queue.h b/src/core/surface/completion_queue.h index 7ef4ed7c49..1f3f0d197b 100644 --- a/src/core/surface/completion_queue.h +++ b/src/core/surface/completion_queue.h @@ -45,7 +45,7 @@ typedef struct grpc_cq_completion void *tag; /** done callback - called when this queue element is no longer needed by the completion queue */ - void (*done) (void *done_arg, struct grpc_cq_completion * c, grpc_closure_list * closure_list); + void (*done) (grpc_exec_ctx * exec_ctx, void *done_arg, struct grpc_cq_completion * c); void *done_arg; /** next pointer; low bit is used to indicate success or not */ gpr_uintptr next; @@ -70,7 +70,7 @@ void grpc_cq_internal_unref (grpc_completion_queue * cc); void grpc_cq_begin_op (grpc_completion_queue * cc); /* Queue a GRPC_OP_COMPLETED operation */ -void grpc_cq_end_op (grpc_completion_queue * cc, void *tag, int success, void (*done) (void *done_arg, grpc_cq_completion * storage, grpc_closure_list * closure_list), void *done_arg, grpc_cq_completion * storage, grpc_closure_list * closure_list); +void grpc_cq_end_op (grpc_completion_queue * cc, void *tag, int success, void (*done) (grpc_exec_ctx * exec_ctx, void *done_arg, grpc_cq_completion * storage, grpc_closure_list * closure_list), void *done_arg, grpc_cq_completion * storage); grpc_pollset *grpc_cq_pollset (grpc_completion_queue * cc); diff --git a/src/core/surface/lame_client.c b/src/core/surface/lame_client.c index d8cf7db601..be3a308f0f 100644 --- a/src/core/surface/lame_client.c +++ b/src/core/surface/lame_client.c @@ -57,7 +57,7 @@ typedef struct } channel_data; static void -lame_start_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +lame_start_transport_stream_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; @@ -92,14 +92,14 @@ lame_start_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_ } static char * -lame_get_peer (grpc_call_element * elem, grpc_closure_list * closure_list) +lame_get_peer (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { channel_data *chand = elem->channel_data; return grpc_channel_get_target (chand->master); } static void -lame_start_transport_op (grpc_channel_element * elem, grpc_transport_op * op, grpc_closure_list * closure_list) +lame_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_transport_op * op) { if (op->on_connectivity_state_change) { @@ -114,7 +114,7 @@ lame_start_transport_op (grpc_channel_element * elem, grpc_transport_op * op, gr } static void -init_call_elem (grpc_call_element * elem, const void *transport_server_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *transport_server_data, grpc_transport_stream_op * initial_op) { if (initial_op) { @@ -123,12 +123,12 @@ init_call_elem (grpc_call_element * elem, const void *transport_server_data, grp } static void -destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { } static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * mdctx, int is_first, int is_last) { channel_data *chand = elem->channel_data; GPR_ASSERT (is_first); @@ -138,7 +138,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp } static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { } diff --git a/src/core/surface/secure_channel_create.c b/src/core/surface/secure_channel_create.c index 64a2d14a49..b65b03a002 100644 --- a/src/core/surface/secure_channel_create.c +++ b/src/core/surface/secure_channel_create.c @@ -79,7 +79,7 @@ connector_ref (grpc_connector * con) } static void -connector_unref (grpc_connector * con, grpc_closure_list * closure_list) +connector_unref (grpc_exec_ctx * exec_ctx, grpc_connector * con) { connector *c = (connector *) con; if (gpr_unref (&c->refs)) @@ -90,7 +90,7 @@ connector_unref (grpc_connector * con, grpc_closure_list * closure_list) } static void -on_secure_handshake_done (void *arg, grpc_security_status status, grpc_endpoint * wrapped_endpoint, grpc_endpoint * secure_endpoint, grpc_closure_list * closure_list) +on_secure_handshake_done (grpc_exec_ctx * exec_ctx, void *arg, grpc_security_status status, grpc_endpoint * wrapped_endpoint, grpc_endpoint * secure_endpoint) { connector *c = arg; grpc_closure *notify; @@ -126,7 +126,7 @@ on_secure_handshake_done (void *arg, grpc_security_status status, grpc_endpoint } static void -connected (void *arg, int success, grpc_closure_list * closure_list) +connected (grpc_exec_ctx * exec_ctx, void *arg, int success) { connector *c = arg; grpc_closure *notify; @@ -149,7 +149,7 @@ connected (void *arg, int success, grpc_closure_list * closure_list) } static void -connector_shutdown (grpc_connector * con, grpc_closure_list * closure_list) +connector_shutdown (grpc_exec_ctx * exec_ctx, grpc_connector * con) { connector *c = (connector *) con; grpc_endpoint *ep; @@ -164,7 +164,7 @@ connector_shutdown (grpc_connector * con, grpc_closure_list * closure_list) } static void -connector_connect (grpc_connector * con, const grpc_connect_in_args * args, grpc_connect_out_args * result, grpc_closure * notify, grpc_closure_list * closure_list) +connector_connect (grpc_exec_ctx * exec_ctx, grpc_connector * con, const grpc_connect_in_args * args, grpc_connect_out_args * result, grpc_closure * notify) { connector *c = (connector *) con; GPR_ASSERT (c->notify == NULL); @@ -201,7 +201,7 @@ subchannel_factory_ref (grpc_subchannel_factory * scf) } static void -subchannel_factory_unref (grpc_subchannel_factory * scf, grpc_closure_list * closure_list) +subchannel_factory_unref (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * scf) { subchannel_factory *f = (subchannel_factory *) scf; if (gpr_unref (&f->refs)) @@ -215,7 +215,7 @@ subchannel_factory_unref (grpc_subchannel_factory * scf, grpc_closure_list * clo } static grpc_subchannel * -subchannel_factory_create_subchannel (grpc_subchannel_factory * scf, grpc_subchannel_args * args, grpc_closure_list * closure_list) +subchannel_factory_create_subchannel (grpc_exec_ctx * exec_ctx, grpc_subchannel_factory * scf, grpc_subchannel_args * args) { subchannel_factory *f = (subchannel_factory *) scf; connector *c = gpr_malloc (sizeof (*c)); diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 8df578d192..793d485dfb 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -57,8 +57,8 @@ typedef struct listener { void *arg; - void (*start) (grpc_server * server, void *arg, grpc_pollset ** pollsets, size_t pollset_count, grpc_closure_list * closure_list); - void (*destroy) (grpc_server * server, void *arg, grpc_closure * closure, grpc_closure_list * closure_list); + void (*start) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_pollset ** pollsets, size_t pollset_count); + void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_closure * closure); struct listener *next; grpc_closure destroy_done; } listener; @@ -240,11 +240,11 @@ struct grpc_server #define SERVER_FROM_CALL_ELEM(elem) \ (((channel_data *)(elem)->channel_data)->server) -static void begin_call (grpc_server * server, call_data * calld, requested_call * rc, grpc_closure_list * closure_list); -static void fail_call (grpc_server * server, requested_call * rc, grpc_closure_list * closure_list); +static void begin_call (grpc_exec_ctx * exec_ctx, grpc_server * server, call_data * calld, requested_call * rc); +static void fail_call (grpc_exec_ctx * exec_ctx, grpc_server * server, requested_call * rc); /* Before calling maybe_finish_shutdown, we must hold mu_global and not hold mu_call */ -static void maybe_finish_shutdown (grpc_server * server, grpc_closure_list * closure_list); +static void maybe_finish_shutdown (grpc_exec_ctx * exec_ctx, grpc_server * server); /* * channel broadcaster @@ -277,7 +277,7 @@ struct shutdown_cleanup_args }; static void -shutdown_cleanup (void *arg, int iomgr_status_ignored, grpc_closure_list * closure_list) +shutdown_cleanup (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_status_ignored) { struct shutdown_cleanup_args *a = arg; gpr_slice_unref (a->slice); @@ -285,7 +285,7 @@ shutdown_cleanup (void *arg, int iomgr_status_ignored, grpc_closure_list * closu } static void -send_shutdown (grpc_channel * channel, int send_goaway, int send_disconnect, grpc_closure_list * closure_list) +send_shutdown (grpc_exec_ctx * exec_ctx, grpc_channel * channel, int send_goaway, int send_disconnect) { grpc_transport_op op; struct shutdown_cleanup_args *sc; @@ -306,7 +306,7 @@ send_shutdown (grpc_channel * channel, int send_goaway, int send_disconnect, grp } static void -channel_broadcaster_shutdown (channel_broadcaster * cb, int send_goaway, int force_disconnect, grpc_closure_list * closure_list) +channel_broadcaster_shutdown (grpc_exec_ctx * exec_ctx, channel_broadcaster * cb, int send_goaway, int force_disconnect) { size_t i; @@ -337,13 +337,13 @@ request_matcher_destroy (request_matcher * request_matcher) } static void -kill_zombie (void *elem, int success, grpc_closure_list * closure_list) +kill_zombie (grpc_exec_ctx * exec_ctx, void *elem, int success) { grpc_call_destroy (grpc_call_from_top_element (elem)); } static void -request_matcher_zombify_all_pending_calls (request_matcher * request_matcher, grpc_closure_list * closure_list) +request_matcher_zombify_all_pending_calls (grpc_exec_ctx * exec_ctx, request_matcher * request_matcher) { while (request_matcher->pending_head) { @@ -358,7 +358,7 @@ request_matcher_zombify_all_pending_calls (request_matcher * request_matcher, gr } static void -request_matcher_kill_requests (grpc_server * server, request_matcher * rm, grpc_closure_list * closure_list) +request_matcher_kill_requests (grpc_exec_ctx * exec_ctx, grpc_server * server, request_matcher * rm) { int request_id; while ((request_id = gpr_stack_lockfree_pop (rm->requests)) != -1) @@ -378,7 +378,7 @@ server_ref (grpc_server * server) } static void -server_delete (grpc_server * server, grpc_closure_list * closure_list) +server_delete (grpc_exec_ctx * exec_ctx, grpc_server * server) { registered_method *rm; size_t i; @@ -408,7 +408,7 @@ server_delete (grpc_server * server, grpc_closure_list * closure_list) } static void -server_unref (grpc_server * server, grpc_closure_list * closure_list) +server_unref (grpc_exec_ctx * exec_ctx, grpc_server * server) { if (gpr_unref (&server->internal_refcount)) { @@ -431,7 +431,7 @@ orphan_channel (channel_data * chand) } static void -finish_destroy_channel (void *cd, int success, grpc_closure_list * closure_list) +finish_destroy_channel (grpc_exec_ctx * exec_ctx, void *cd, int success) { channel_data *chand = cd; grpc_server *server = chand->server; @@ -441,7 +441,7 @@ finish_destroy_channel (void *cd, int success, grpc_closure_list * closure_list) } static void -destroy_channel (channel_data * chand, grpc_closure_list * closure_list) +destroy_channel (grpc_exec_ctx * exec_ctx, channel_data * chand) { if (is_channel_orphaned (chand)) return; @@ -455,7 +455,7 @@ destroy_channel (channel_data * chand, grpc_closure_list * closure_list) } static void -finish_start_new_rpc (grpc_server * server, grpc_call_element * elem, request_matcher * request_matcher, grpc_closure_list * closure_list) +finish_start_new_rpc (grpc_exec_ctx * exec_ctx, grpc_server * server, grpc_call_element * elem, request_matcher * request_matcher) { call_data *calld = elem->call_data; int request_id; @@ -499,7 +499,7 @@ finish_start_new_rpc (grpc_server * server, grpc_call_element * elem, request_ma } static void -start_new_rpc (grpc_call_element * elem, grpc_closure_list * closure_list) +start_new_rpc (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { channel_data *chand = elem->channel_data; call_data *calld = elem->call_data; @@ -556,7 +556,7 @@ num_listeners (grpc_server * server) } static void -done_shutdown_event (void *server, grpc_cq_completion * completion, grpc_closure_list * closure_list) +done_shutdown_event (grpc_exec_ctx * exec_ctx, void *server, grpc_cq_completion * completion) { server_unref (server, closure_list); } @@ -574,7 +574,7 @@ num_channels (grpc_server * server) } static void -kill_pending_work_locked (grpc_server * server, grpc_closure_list * closure_list) +kill_pending_work_locked (grpc_exec_ctx * exec_ctx, grpc_server * server) { registered_method *rm; request_matcher_kill_requests (server, &server->unregistered_request_matcher, closure_list); @@ -587,7 +587,7 @@ kill_pending_work_locked (grpc_server * server, grpc_closure_list * closure_list } static void -maybe_finish_shutdown (grpc_server * server, grpc_closure_list * closure_list) +maybe_finish_shutdown (grpc_exec_ctx * exec_ctx, grpc_server * server) { size_t i; if (!gpr_atm_acq_load (&server->shutdown_flag) || server->shutdown_published) @@ -634,7 +634,7 @@ server_filter (void *user_data, grpc_mdelem * md) } static void -server_on_recv (void *ptr, int success, grpc_closure_list * closure_list) +server_on_recv (grpc_exec_ctx * exec_ctx, void *ptr, int success) { grpc_call_element *elem = ptr; call_data *calld = elem->call_data; @@ -727,7 +727,7 @@ server_mutate_op (grpc_call_element * elem, grpc_transport_stream_op * op) } static void -server_start_transport_stream_op (grpc_call_element * elem, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +server_start_transport_stream_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op) { GRPC_CALL_LOG_OP (GPR_INFO, elem, op); server_mutate_op (elem, op); @@ -743,7 +743,7 @@ accept_stream (void *cd, grpc_transport * transport, const void *transport_serve } static void -channel_connectivity_changed (void *cd, int iomgr_status_ignored, grpc_closure_list * closure_list) +channel_connectivity_changed (grpc_exec_ctx * exec_ctx, void *cd, int iomgr_status_ignored) { channel_data *chand = cd; grpc_server *server = chand->server; @@ -764,7 +764,7 @@ channel_connectivity_changed (void *cd, int iomgr_status_ignored, grpc_closure_l } static void -init_call_elem (grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *server_transport_data, grpc_transport_stream_op * initial_op) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; @@ -782,7 +782,7 @@ init_call_elem (grpc_call_element * elem, const void *server_transport_data, grp } static void -destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) +destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem) { channel_data *chand = elem->channel_data; call_data *calld = elem->call_data; @@ -804,7 +804,7 @@ destroy_call_elem (grpc_call_element * elem, grpc_closure_list * closure_list) } static void -init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, int is_first, int is_last, grpc_closure_list * closure_list) +init_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem, grpc_channel * master, const grpc_channel_args * args, grpc_mdctx * metadata_context, int is_first, int is_last) { channel_data *chand = elem->channel_data; GPR_ASSERT (is_first); @@ -820,7 +820,7 @@ init_channel_elem (grpc_channel_element * elem, grpc_channel * master, const grp } static void -destroy_channel_elem (grpc_channel_element * elem, grpc_closure_list * closure_list) +destroy_channel_elem (grpc_exec_ctx * exec_ctx, grpc_channel_element * elem) { size_t i; channel_data *chand = elem->channel_data; @@ -998,7 +998,7 @@ grpc_server_start (grpc_server * server) } void -grpc_server_setup_transport (grpc_server * s, grpc_transport * transport, grpc_channel_filter const **extra_filters, size_t num_extra_filters, grpc_mdctx * mdctx, const grpc_channel_args * args, grpc_closure_list * closure_list) +grpc_server_setup_transport (grpc_exec_ctx * exec_ctx, grpc_server * s, grpc_transport * transport, grpc_channel_filter const **extra_filters, size_t num_extra_filters, grpc_mdctx * mdctx, const grpc_channel_args * args) { size_t num_filters = s->channel_filter_count + num_extra_filters + 1; grpc_channel_filter const **filters = gpr_malloc (sizeof (grpc_channel_filter *) * num_filters); @@ -1093,14 +1093,14 @@ grpc_server_setup_transport (grpc_server * s, grpc_transport * transport, grpc_c } void -done_published_shutdown (void *done_arg, grpc_cq_completion * storage, grpc_closure_list * closure_list) +done_published_shutdown (grpc_exec_ctx * exec_ctx, void *done_arg, grpc_cq_completion * storage) { (void) done_arg; gpr_free (storage); } static void -listener_destroy_done (void *s, int success, grpc_closure_list * closure_list) +listener_destroy_done (grpc_exec_ctx * exec_ctx, void *s, int success) { grpc_server *server = s; gpr_mu_lock (&server->mu_global); @@ -1202,7 +1202,7 @@ grpc_server_destroy (grpc_server * server) } void -grpc_server_add_listener (grpc_server * server, void *arg, void (*start) (grpc_server * server, void *arg, grpc_pollset ** pollsets, size_t pollset_count, grpc_closure_list * closure_list), void (*destroy) (grpc_server * server, void *arg, grpc_closure * on_done, grpc_closure_list * closure_list), grpc_closure_list * closure_list) +grpc_server_add_listener (grpc_server * server, void *arg, void (*start) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_pollset ** pollsets, size_t pollset_count), void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_closure * on_done, grpc_closure_list * closure_list)) { listener *l = gpr_malloc (sizeof (listener)); l->arg = arg; @@ -1213,7 +1213,7 @@ grpc_server_add_listener (grpc_server * server, void *arg, void (*start) (grpc_s } static grpc_call_error -queue_call_request (grpc_server * server, requested_call * rc, grpc_closure_list * closure_list) +queue_call_request (grpc_exec_ctx * exec_ctx, grpc_server * server, requested_call * rc) { call_data *calld = NULL; request_matcher *request_matcher = NULL; @@ -1333,9 +1333,9 @@ done: return error; } -static void publish_registered_or_batch (grpc_call * call, int success, void *tag, grpc_closure_list * closure_list); +static void publish_registered_or_batch (grpc_exec_ctx * exec_ctx, grpc_call * call, int success, void *tag); static void -publish_was_not_set (grpc_call * call, int success, void *tag, grpc_closure_list * closure_list) +publish_was_not_set (grpc_exec_ctx * exec_ctx, grpc_call * call, int success, void *tag) { abort (); } @@ -1355,7 +1355,7 @@ cpstr (char **dest, size_t * capacity, grpc_mdstr * value) } static void -begin_call (grpc_server * server, call_data * calld, requested_call * rc, grpc_closure_list * closure_list) +begin_call (grpc_exec_ctx * exec_ctx, grpc_server * server, call_data * calld, requested_call * rc) { grpc_ioreq_completion_func publish = publish_was_not_set; grpc_ioreq req[2]; @@ -1406,7 +1406,7 @@ begin_call (grpc_server * server, call_data * calld, requested_call * rc, grpc_c } static void -done_request_event (void *req, grpc_cq_completion * c, grpc_closure_list * closure_list) +done_request_event (grpc_exec_ctx * exec_ctx, void *req, grpc_cq_completion * c) { requested_call *rc = req; grpc_server *server = rc->server; @@ -1425,7 +1425,7 @@ done_request_event (void *req, grpc_cq_completion * c, grpc_closure_list * closu } static void -fail_call (grpc_server * server, requested_call * rc, grpc_closure_list * closure_list) +fail_call (grpc_exec_ctx * exec_ctx, grpc_server * server, requested_call * rc) { *rc->call = NULL; switch (rc->type) @@ -1442,7 +1442,7 @@ fail_call (grpc_server * server, requested_call * rc, grpc_closure_list * closur } static void -publish_registered_or_batch (grpc_call * call, int success, void *prc, grpc_closure_list * closure_list) +publish_registered_or_batch (grpc_exec_ctx * exec_ctx, grpc_call * call, int success, void *prc) { grpc_call_element *elem = grpc_call_stack_element (grpc_call_get_call_stack (call), 0); requested_call *rc = prc; diff --git a/src/core/surface/server.h b/src/core/surface/server.h index 081377167a..8adaafd5e3 100644 --- a/src/core/surface/server.h +++ b/src/core/surface/server.h @@ -43,11 +43,11 @@ grpc_server *grpc_server_create_from_filters (const grpc_channel_filter ** filte /* Add a listener to the server: when the server starts, it will call start, and when it shuts down, it will call destroy */ -void grpc_server_add_listener (grpc_server * server, void *listener, void (*start) (grpc_server * server, void *arg, grpc_pollset ** pollsets, size_t npollsets, grpc_closure_list * closure_list), void (*destroy) (grpc_server * server, void *arg, grpc_closure * on_done, grpc_closure_list * closure_list), grpc_closure_list * closure_list); +void grpc_server_add_listener (grpc_server * server, void *listener, void (*start) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_pollset ** pollsets, size_t npollsets), void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_closure * on_done, grpc_closure_list * closure_list)); /* Setup a transport - creates a channel stack, binds the transport to the server */ -void grpc_server_setup_transport (grpc_server * server, grpc_transport * transport, grpc_channel_filter const **extra_filters, size_t num_extra_filters, grpc_mdctx * mdctx, const grpc_channel_args * args, grpc_closure_list * closure_list); +void grpc_server_setup_transport (grpc_exec_ctx * exec_ctx, grpc_server * server, grpc_transport * transport, grpc_channel_filter const **extra_filters, size_t num_extra_filters, grpc_mdctx * mdctx, const grpc_channel_args * args); const grpc_channel_args *grpc_server_get_channel_args (grpc_server * server); diff --git a/src/core/surface/server_chttp2.c b/src/core/surface/server_chttp2.c index 47b96f8f1e..aa4eb9b05b 100644 --- a/src/core/surface/server_chttp2.c +++ b/src/core/surface/server_chttp2.c @@ -43,7 +43,7 @@ #include <grpc/support/useful.h> static void -setup_transport (void *server, grpc_transport * transport, grpc_mdctx * mdctx, grpc_closure_list * closure_list) +setup_transport (grpc_exec_ctx * exec_ctx, void *server, grpc_transport * transport, grpc_mdctx * mdctx) { static grpc_channel_filter const *extra_filters[] = { &grpc_http_server_filter @@ -52,7 +52,7 @@ setup_transport (void *server, grpc_transport * transport, grpc_mdctx * mdctx, g } static void -new_transport (void *server, grpc_endpoint * tcp, grpc_closure_list * closure_list) +new_transport (grpc_exec_ctx * exec_ctx, void *server, grpc_endpoint * tcp) { /* * Beware that the call to grpc_create_chttp2_transport() has to happen before @@ -69,7 +69,7 @@ new_transport (void *server, grpc_endpoint * tcp, grpc_closure_list * closure_li /* Server callback: start listening on our ports */ static void -start (grpc_server * server, void *tcpp, grpc_pollset ** pollsets, size_t pollset_count, grpc_closure_list * closure_list) +start (grpc_exec_ctx * exec_ctx, grpc_server * server, void *tcpp, grpc_pollset ** pollsets, size_t pollset_count) { grpc_tcp_server *tcp = tcpp; grpc_tcp_server_start (tcp, pollsets, pollset_count, new_transport, server, closure_list); @@ -78,7 +78,7 @@ start (grpc_server * server, void *tcpp, grpc_pollset ** pollsets, size_t pollse /* Server callback: destroy the tcp listener (so we don't generate further callbacks) */ static void -destroy (grpc_server * server, void *tcpp, grpc_closure * destroy_done, grpc_closure_list * closure_list) +destroy (grpc_exec_ctx * exec_ctx, grpc_server * server, void *tcpp, grpc_closure * destroy_done) { grpc_tcp_server *tcp = tcpp; grpc_tcp_server_destroy (tcp, destroy_done, closure_list); diff --git a/src/core/transport/chttp2/frame_data.c b/src/core/transport/chttp2/frame_data.c index 461a1e26f8..a806e357a8 100644 --- a/src/core/transport/chttp2/frame_data.c +++ b/src/core/transport/chttp2/frame_data.c @@ -78,7 +78,7 @@ grpc_chttp2_data_parser_begin_frame (grpc_chttp2_data_parser * parser, gpr_uint8 } grpc_chttp2_parse_error -grpc_chttp2_data_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list) +grpc_chttp2_data_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last) { gpr_uint8 *const beg = GPR_SLICE_START_PTR (slice); gpr_uint8 *const end = GPR_SLICE_END_PTR (slice); diff --git a/src/core/transport/chttp2/frame_data.h b/src/core/transport/chttp2/frame_data.h index 6284433b19..18c7e00cd1 100644 --- a/src/core/transport/chttp2/frame_data.h +++ b/src/core/transport/chttp2/frame_data.h @@ -73,7 +73,7 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_begin_frame (grpc_chttp2_data_pa /* handle a slice of a data frame - is_last indicates the last slice of a frame */ -grpc_chttp2_parse_error grpc_chttp2_data_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list); +grpc_chttp2_parse_error grpc_chttp2_data_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last); /* create a slice with an empty data frame and is_last set */ gpr_slice grpc_chttp2_data_frame_create_empty_close (gpr_uint32 id); diff --git a/src/core/transport/chttp2/frame_goaway.c b/src/core/transport/chttp2/frame_goaway.c index f990e86465..891e77e333 100644 --- a/src/core/transport/chttp2/frame_goaway.c +++ b/src/core/transport/chttp2/frame_goaway.c @@ -69,7 +69,7 @@ grpc_chttp2_goaway_parser_begin_frame (grpc_chttp2_goaway_parser * p, gpr_uint32 } grpc_chttp2_parse_error -grpc_chttp2_goaway_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list) +grpc_chttp2_goaway_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last) { gpr_uint8 *const beg = GPR_SLICE_START_PTR (slice); gpr_uint8 *const end = GPR_SLICE_END_PTR (slice); diff --git a/src/core/transport/chttp2/frame_goaway.h b/src/core/transport/chttp2/frame_goaway.h index 7cacec5f94..f1eada9881 100644 --- a/src/core/transport/chttp2/frame_goaway.h +++ b/src/core/transport/chttp2/frame_goaway.h @@ -66,7 +66,7 @@ typedef struct void grpc_chttp2_goaway_parser_init (grpc_chttp2_goaway_parser * p); void grpc_chttp2_goaway_parser_destroy (grpc_chttp2_goaway_parser * p); grpc_chttp2_parse_error grpc_chttp2_goaway_parser_begin_frame (grpc_chttp2_goaway_parser * parser, gpr_uint32 length, gpr_uint8 flags); -grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list); +grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last); void grpc_chttp2_goaway_append (gpr_uint32 last_stream_id, gpr_uint32 error_code, gpr_slice debug_data, gpr_slice_buffer * slice_buffer); diff --git a/src/core/transport/chttp2/frame_ping.c b/src/core/transport/chttp2/frame_ping.c index 6cd1fae1a6..2038a4eb27 100644 --- a/src/core/transport/chttp2/frame_ping.c +++ b/src/core/transport/chttp2/frame_ping.c @@ -73,7 +73,7 @@ grpc_chttp2_ping_parser_begin_frame (grpc_chttp2_ping_parser * parser, gpr_uint3 } grpc_chttp2_parse_error -grpc_chttp2_ping_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list) +grpc_chttp2_ping_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last) { gpr_uint8 *const beg = GPR_SLICE_START_PTR (slice); gpr_uint8 *const end = GPR_SLICE_END_PTR (slice); diff --git a/src/core/transport/chttp2/frame_ping.h b/src/core/transport/chttp2/frame_ping.h index 65a666bc18..066573940a 100644 --- a/src/core/transport/chttp2/frame_ping.h +++ b/src/core/transport/chttp2/frame_ping.h @@ -48,6 +48,6 @@ typedef struct gpr_slice grpc_chttp2_ping_create (gpr_uint8 ack, gpr_uint8 * opaque_8bytes); grpc_chttp2_parse_error grpc_chttp2_ping_parser_begin_frame (grpc_chttp2_ping_parser * parser, gpr_uint32 length, gpr_uint8 flags); -grpc_chttp2_parse_error grpc_chttp2_ping_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list); +grpc_chttp2_parse_error grpc_chttp2_ping_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last); #endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_PING_H */ diff --git a/src/core/transport/chttp2/frame_rst_stream.c b/src/core/transport/chttp2/frame_rst_stream.c index c4bca3e680..545d1b42b9 100644 --- a/src/core/transport/chttp2/frame_rst_stream.c +++ b/src/core/transport/chttp2/frame_rst_stream.c @@ -74,7 +74,7 @@ grpc_chttp2_rst_stream_parser_begin_frame (grpc_chttp2_rst_stream_parser * parse } grpc_chttp2_parse_error -grpc_chttp2_rst_stream_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list) +grpc_chttp2_rst_stream_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last) { gpr_uint8 *const beg = GPR_SLICE_START_PTR (slice); gpr_uint8 *const end = GPR_SLICE_END_PTR (slice); diff --git a/src/core/transport/chttp2/frame_rst_stream.h b/src/core/transport/chttp2/frame_rst_stream.h index 781f4e5743..b222e70861 100644 --- a/src/core/transport/chttp2/frame_rst_stream.h +++ b/src/core/transport/chttp2/frame_rst_stream.h @@ -47,6 +47,6 @@ typedef struct gpr_slice grpc_chttp2_rst_stream_create (gpr_uint32 stream_id, gpr_uint32 code); grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_begin_frame (grpc_chttp2_rst_stream_parser * parser, gpr_uint32 length, gpr_uint8 flags); -grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list); +grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last); #endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H */ diff --git a/src/core/transport/chttp2/frame_settings.c b/src/core/transport/chttp2/frame_settings.c index 7f2d5ba3fe..4b6204e6ea 100644 --- a/src/core/transport/chttp2/frame_settings.c +++ b/src/core/transport/chttp2/frame_settings.c @@ -151,7 +151,7 @@ grpc_chttp2_settings_parser_begin_frame (grpc_chttp2_settings_parser * parser, g } grpc_chttp2_parse_error -grpc_chttp2_settings_parser_parse (void *p, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list) +grpc_chttp2_settings_parser_parse (grpc_exec_ctx * exec_ctx, void *p, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last) { grpc_chttp2_settings_parser *parser = p; const gpr_uint8 *cur = GPR_SLICE_START_PTR (slice); diff --git a/src/core/transport/chttp2/frame_settings.h b/src/core/transport/chttp2/frame_settings.h index 36c2c1d6d4..3c57e3ae89 100644 --- a/src/core/transport/chttp2/frame_settings.h +++ b/src/core/transport/chttp2/frame_settings.h @@ -95,6 +95,6 @@ gpr_slice grpc_chttp2_settings_create (gpr_uint32 * old, const gpr_uint32 * new, gpr_slice grpc_chttp2_settings_ack_create (void); grpc_chttp2_parse_error grpc_chttp2_settings_parser_begin_frame (grpc_chttp2_settings_parser * parser, gpr_uint32 length, gpr_uint8 flags, gpr_uint32 * settings); -grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list); +grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last); #endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_SETTINGS_H */ diff --git a/src/core/transport/chttp2/frame_window_update.c b/src/core/transport/chttp2/frame_window_update.c index e18fc1f694..81f2ce2b52 100644 --- a/src/core/transport/chttp2/frame_window_update.c +++ b/src/core/transport/chttp2/frame_window_update.c @@ -75,7 +75,7 @@ grpc_chttp2_window_update_parser_begin_frame (grpc_chttp2_window_update_parser * } grpc_chttp2_parse_error -grpc_chttp2_window_update_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list) +grpc_chttp2_window_update_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last) { gpr_uint8 *const beg = GPR_SLICE_START_PTR (slice); gpr_uint8 *const end = GPR_SLICE_END_PTR (slice); diff --git a/src/core/transport/chttp2/frame_window_update.h b/src/core/transport/chttp2/frame_window_update.h index 57d77b41cf..b6b61e8987 100644 --- a/src/core/transport/chttp2/frame_window_update.h +++ b/src/core/transport/chttp2/frame_window_update.h @@ -48,6 +48,6 @@ typedef struct gpr_slice grpc_chttp2_window_update_create (gpr_uint32 id, gpr_uint32 window_delta); grpc_chttp2_parse_error grpc_chttp2_window_update_parser_begin_frame (grpc_chttp2_window_update_parser * parser, gpr_uint32 length, gpr_uint8 flags); -grpc_chttp2_parse_error grpc_chttp2_window_update_parser_parse (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list); +grpc_chttp2_parse_error grpc_chttp2_window_update_parser_parse (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last); #endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H */ diff --git a/src/core/transport/chttp2/hpack_parser.c b/src/core/transport/chttp2/hpack_parser.c index f3af6d91d2..0d19a577cc 100644 --- a/src/core/transport/chttp2/hpack_parser.c +++ b/src/core/transport/chttp2/hpack_parser.c @@ -1458,7 +1458,7 @@ grpc_chttp2_hpack_parser_parse (grpc_chttp2_hpack_parser * p, const gpr_uint8 * } grpc_chttp2_parse_error -grpc_chttp2_header_parser_parse (void *hpack_parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list) +grpc_chttp2_header_parser_parse (grpc_exec_ctx * exec_ctx, void *hpack_parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last) { grpc_chttp2_hpack_parser *parser = hpack_parser; if (!grpc_chttp2_hpack_parser_parse (parser, GPR_SLICE_START_PTR (slice), GPR_SLICE_END_PTR (slice))) diff --git a/src/core/transport/chttp2/hpack_parser.h b/src/core/transport/chttp2/hpack_parser.h index 6d21202d4d..209bb6b9c1 100644 --- a/src/core/transport/chttp2/hpack_parser.h +++ b/src/core/transport/chttp2/hpack_parser.h @@ -106,6 +106,6 @@ int grpc_chttp2_hpack_parser_parse (grpc_chttp2_hpack_parser * p, const gpr_uint /* wraps grpc_chttp2_hpack_parser_parse to provide a frame level parser for the transport */ -grpc_chttp2_parse_error grpc_chttp2_header_parser_parse (void *hpack_parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list); +grpc_chttp2_parse_error grpc_chttp2_header_parser_parse (grpc_exec_ctx * exec_ctx, void *hpack_parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last); #endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_PARSER_H */ diff --git a/src/core/transport/chttp2/internal.h b/src/core/transport/chttp2/internal.h index 1ef9c1af87..aaf090cd44 100644 --- a/src/core/transport/chttp2/internal.h +++ b/src/core/transport/chttp2/internal.h @@ -277,7 +277,7 @@ struct grpc_chttp2_transport_parsing /* active parser */ void *parser_data; grpc_chttp2_stream_parsing *incoming_stream; - grpc_chttp2_parse_error (*parser) (void *parser_user_data, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list); + grpc_chttp2_parse_error (*parser) (grpc_exec_ctx * exec_ctx, void *parser_user_data, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last); /* received settings */ gpr_uint32 settings[GRPC_CHTTP2_NUM_SETTINGS]; @@ -480,15 +480,15 @@ struct grpc_chttp2_stream /** Someone is unlocking the transport mutex: check to see if writes are required, and schedule them if so */ int grpc_chttp2_unlocking_check_writes (grpc_chttp2_transport_global * global, grpc_chttp2_transport_writing * writing); -void grpc_chttp2_perform_writes (grpc_chttp2_transport_writing * transport_writing, grpc_endpoint * endpoint, grpc_closure_list * closure_list); -void grpc_chttp2_terminate_writing (void *transport_writing, int success, grpc_closure_list * closure_list); -void grpc_chttp2_cleanup_writing (grpc_chttp2_transport_global * global, grpc_chttp2_transport_writing * writing, grpc_closure_list * closure_list); +void grpc_chttp2_perform_writes (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_writing * transport_writing, grpc_endpoint * endpoint); +void grpc_chttp2_terminate_writing (grpc_exec_ctx * exec_ctx, void *transport_writing, int success); +void grpc_chttp2_cleanup_writing (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * global, grpc_chttp2_transport_writing * writing); void grpc_chttp2_prepare_to_read (grpc_chttp2_transport_global * global, grpc_chttp2_transport_parsing * parsing); /** Process one slice of incoming data; return 1 if the connection is still viable after reading, or 0 if the connection should be torn down */ -int grpc_chttp2_perform_read (grpc_chttp2_transport_parsing * transport_parsing, gpr_slice slice, grpc_closure_list * closure_list); -void grpc_chttp2_publish_reads (grpc_chttp2_transport_global * global, grpc_chttp2_transport_parsing * parsing, grpc_closure_list * closure_list); +int grpc_chttp2_perform_read (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_parsing * transport_parsing, gpr_slice slice); +void grpc_chttp2_publish_reads (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * global, grpc_chttp2_transport_parsing * parsing); /** Get a writable stream returns non-zero if there was a stream available */ @@ -526,7 +526,7 @@ int grpc_chttp2_list_pop_read_write_state_changed (grpc_chttp2_transport_global grpc_chttp2_stream_parsing *grpc_chttp2_parsing_lookup_stream (grpc_chttp2_transport_parsing * transport_parsing, gpr_uint32 id); grpc_chttp2_stream_parsing *grpc_chttp2_parsing_accept_stream (grpc_chttp2_transport_parsing * transport_parsing, gpr_uint32 id); -void grpc_chttp2_add_incoming_goaway (grpc_chttp2_transport_global * transport_global, gpr_uint32 goaway_error, gpr_slice goaway_text, grpc_closure_list * closure_list); +void grpc_chttp2_add_incoming_goaway (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global, gpr_uint32 goaway_error, gpr_slice goaway_text); void grpc_chttp2_register_stream (grpc_chttp2_transport * t, grpc_chttp2_stream * s); /* returns 1 if this is the last stream, 0 otherwise */ diff --git a/src/core/transport/chttp2/parsing.c b/src/core/transport/chttp2/parsing.c index 944066eab3..8e1dfc9d36 100644 --- a/src/core/transport/chttp2/parsing.c +++ b/src/core/transport/chttp2/parsing.c @@ -52,7 +52,7 @@ static int init_ping_parser (grpc_chttp2_transport_parsing * transport_parsing); static int init_goaway_parser (grpc_chttp2_transport_parsing * transport_parsing); static int init_skip_frame_parser (grpc_chttp2_transport_parsing * transport_parsing, int is_header); -static int parse_frame_slice (grpc_chttp2_transport_parsing * transport_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list); +static int parse_frame_slice (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_parsing * transport_parsing, gpr_slice slice, int is_last); void grpc_chttp2_prepare_to_read (grpc_chttp2_transport_global * transport_global, grpc_chttp2_transport_parsing * transport_parsing) @@ -80,7 +80,7 @@ grpc_chttp2_prepare_to_read (grpc_chttp2_transport_global * transport_global, gr } void -grpc_chttp2_publish_reads (grpc_chttp2_transport_global * transport_global, grpc_chttp2_transport_parsing * transport_parsing, grpc_closure_list * closure_list) +grpc_chttp2_publish_reads (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global, grpc_chttp2_transport_parsing * transport_parsing) { grpc_chttp2_stream_global *stream_global; grpc_chttp2_stream_parsing *stream_parsing; @@ -202,7 +202,7 @@ grpc_chttp2_publish_reads (grpc_chttp2_transport_global * transport_global, grpc } int -grpc_chttp2_perform_read (grpc_chttp2_transport_parsing * transport_parsing, gpr_slice slice, grpc_closure_list * closure_list) +grpc_chttp2_perform_read (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_parsing * transport_parsing, gpr_slice slice) { gpr_uint8 *beg = GPR_SLICE_START_PTR (slice); gpr_uint8 *end = GPR_SLICE_END_PTR (slice); @@ -441,7 +441,7 @@ init_frame_parser (grpc_chttp2_transport_parsing * transport_parsing) } static grpc_chttp2_parse_error -skip_parser (void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list) +skip_parser (grpc_exec_ctx * exec_ctx, void *parser, grpc_chttp2_transport_parsing * transport_parsing, grpc_chttp2_stream_parsing * stream_parsing, gpr_slice slice, int is_last) { return GRPC_CHTTP2_PARSE_OK; } @@ -754,7 +754,7 @@ static int is_window_update_legal(gpr_int64 window_update, gpr_int64 window) { */ static int -parse_frame_slice (grpc_chttp2_transport_parsing * transport_parsing, gpr_slice slice, int is_last, grpc_closure_list * closure_list) +parse_frame_slice (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_parsing * transport_parsing, gpr_slice slice, int is_last) { grpc_chttp2_stream_parsing *stream_parsing = transport_parsing->incoming_stream; switch (transport_parsing->parser (transport_parsing->parser_data, transport_parsing, stream_parsing, slice, is_last, closure_list)) diff --git a/src/core/transport/chttp2/writing.c b/src/core/transport/chttp2/writing.c index edf40f54fb..6c4f0102f7 100644 --- a/src/core/transport/chttp2/writing.c +++ b/src/core/transport/chttp2/writing.c @@ -141,7 +141,7 @@ grpc_chttp2_unlocking_check_writes (grpc_chttp2_transport_global * transport_glo } void -grpc_chttp2_perform_writes (grpc_chttp2_transport_writing * transport_writing, grpc_endpoint * endpoint, grpc_closure_list * closure_list) +grpc_chttp2_perform_writes (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_writing * transport_writing, grpc_endpoint * endpoint) { GPR_ASSERT (transport_writing->outbuf.count > 0 || grpc_chttp2_list_have_writing_streams (transport_writing)); @@ -180,7 +180,7 @@ finalize_outbuf (grpc_chttp2_transport_writing * transport_writing) } void -grpc_chttp2_cleanup_writing (grpc_chttp2_transport_global * transport_global, grpc_chttp2_transport_writing * transport_writing, grpc_closure_list * closure_list) +grpc_chttp2_cleanup_writing (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global, grpc_chttp2_transport_writing * transport_writing) { grpc_chttp2_stream_writing *stream_writing; grpc_chttp2_stream_global *stream_global; diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index f99fa52dcc..bef7d03300 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -78,24 +78,24 @@ int grpc_flowctl_trace = 0; static const grpc_transport_vtable vtable; static void lock (grpc_chttp2_transport * t); -static void unlock (grpc_chttp2_transport * t, grpc_closure_list * closure_list); +static void unlock (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t); -static void unlock_check_read_write_state (grpc_chttp2_transport * t, grpc_closure_list * closure_list); +static void unlock_check_read_write_state (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t); /* forward declarations of various callbacks that we'll build closures around */ -static void writing_action (void *t, int iomgr_success_ignored, grpc_closure_list * closure_list); +static void writing_action (grpc_exec_ctx * exec_ctx, void *t, int iomgr_success_ignored); /** Set a transport level setting, and push it to our peer */ static void push_setting (grpc_chttp2_transport * t, grpc_chttp2_setting_id id, gpr_uint32 value); /** Endpoint callback to process incoming data */ -static void recv_data (void *tp, int success, grpc_closure_list * closure_list); +static void recv_data (grpc_exec_ctx * exec_ctx, void *tp, int success); /** Start disconnection chain */ -static void drop_connection (grpc_chttp2_transport * t, grpc_closure_list * closure_list); +static void drop_connection (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t); /** Perform a transport_op */ -static void perform_stream_op_locked (grpc_chttp2_transport_global * transport_global, grpc_chttp2_stream_global * stream_global, grpc_transport_stream_op * op, grpc_closure_list * closure_list); +static void perform_stream_op_locked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global, grpc_chttp2_stream_global * stream_global, grpc_transport_stream_op * op); /** Cancel a stream: coming from the transport API */ static void cancel_from_api (grpc_chttp2_transport_global * transport_global, grpc_chttp2_stream_global * stream_global, grpc_status_code status); @@ -103,20 +103,20 @@ static void cancel_from_api (grpc_chttp2_transport_global * transport_global, gr static void close_from_api (grpc_chttp2_transport_global * transport_global, grpc_chttp2_stream_global * stream_global, grpc_status_code status, gpr_slice * optional_message); /** Add endpoint from this transport to pollset */ -static void add_to_pollset_locked (grpc_chttp2_transport * t, grpc_pollset * pollset, grpc_closure_list * closure_list); -static void add_to_pollset_set_locked (grpc_chttp2_transport * t, grpc_pollset_set * pollset_set, grpc_closure_list * closure_list); +static void add_to_pollset_locked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t, grpc_pollset * pollset); +static void add_to_pollset_set_locked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t, grpc_pollset_set * pollset_set); /** Start new streams that have been created if we can */ -static void maybe_start_some_streams (grpc_chttp2_transport_global * transport_global, grpc_closure_list * closure_list); +static void maybe_start_some_streams (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global); -static void connectivity_state_set (grpc_chttp2_transport_global * transport_global, grpc_connectivity_state state, const char *reason, grpc_closure_list * closure_list); +static void connectivity_state_set (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global, grpc_connectivity_state state, const char *reason); /* * CONSTRUCTION/DESTRUCTION/REFCOUNTING */ static void -destruct_transport (grpc_chttp2_transport * t, grpc_closure_list * closure_list) +destruct_transport (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t) { size_t i; @@ -191,7 +191,7 @@ ref_transport (grpc_chttp2_transport * t, const char *reason, const char *file, #define REF_TRANSPORT(t, r) ref_transport(t) #define UNREF_TRANSPORT(t, r, cl) unref_transport(t, cl) static void -unref_transport (grpc_chttp2_transport * t, grpc_closure_list * closure_list) +unref_transport (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t) { if (!gpr_unref (&t->refs)) return; @@ -206,7 +206,7 @@ ref_transport (grpc_chttp2_transport * t) #endif static void -init_transport (grpc_chttp2_transport * t, const grpc_channel_args * channel_args, grpc_endpoint * ep, grpc_mdctx * mdctx, gpr_uint8 is_client, grpc_closure_list * closure_list) +init_transport (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t, const grpc_channel_args * channel_args, grpc_endpoint * ep, grpc_mdctx * mdctx, gpr_uint8 is_client) { size_t i; int j; @@ -327,7 +327,7 @@ init_transport (grpc_chttp2_transport * t, const grpc_channel_args * channel_arg } static void -destroy_transport (grpc_transport * gt, grpc_closure_list * closure_list) +destroy_transport (grpc_exec_ctx * exec_ctx, grpc_transport * gt) { grpc_chttp2_transport *t = (grpc_chttp2_transport *) gt; @@ -349,7 +349,7 @@ prevent_endpoint_shutdown (grpc_chttp2_transport * t) } static void -allow_endpoint_shutdown_locked (grpc_chttp2_transport * t, grpc_closure_list * closure_list) +allow_endpoint_shutdown_locked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t) { if (gpr_unref (&t->shutdown_ep_refs)) { @@ -361,7 +361,7 @@ allow_endpoint_shutdown_locked (grpc_chttp2_transport * t, grpc_closure_list * c } static void -allow_endpoint_shutdown_unlocked (grpc_chttp2_transport * t, grpc_closure_list * closure_list) +allow_endpoint_shutdown_unlocked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t) { if (gpr_unref (&t->shutdown_ep_refs)) { @@ -375,7 +375,7 @@ allow_endpoint_shutdown_unlocked (grpc_chttp2_transport * t, grpc_closure_list * } static void -destroy_endpoint (grpc_chttp2_transport * t, grpc_closure_list * closure_list) +destroy_endpoint (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t) { grpc_endpoint_destroy (t->ep, closure_list); t->ep = NULL; @@ -384,7 +384,7 @@ destroy_endpoint (grpc_chttp2_transport * t, grpc_closure_list * closure_list) } static void -close_transport_locked (grpc_chttp2_transport * t, grpc_closure_list * closure_list) +close_transport_locked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t) { if (!t->closed) { @@ -398,7 +398,7 @@ close_transport_locked (grpc_chttp2_transport * t, grpc_closure_list * closure_l } static int -init_stream (grpc_transport * gt, grpc_stream * gs, const void *server_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +init_stream (grpc_exec_ctx * exec_ctx, grpc_transport * gt, grpc_stream * gs, const void *server_data, grpc_transport_stream_op * initial_op) { grpc_chttp2_transport *t = (grpc_chttp2_transport *) gt; grpc_chttp2_stream *s = (grpc_chttp2_stream *) gs; @@ -434,7 +434,7 @@ init_stream (grpc_transport * gt, grpc_stream * gs, const void *server_data, grp } static void -destroy_stream (grpc_transport * gt, grpc_stream * gs, grpc_closure_list * closure_list) +destroy_stream (grpc_exec_ctx * exec_ctx, grpc_transport * gt, grpc_stream * gs) { grpc_chttp2_transport *t = (grpc_chttp2_transport *) gt; grpc_chttp2_stream *s = (grpc_chttp2_stream *) gs; @@ -516,7 +516,7 @@ lock (grpc_chttp2_transport * t) } static void -unlock (grpc_chttp2_transport * t, grpc_closure_list * closure_list) +unlock (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t) { unlock_check_read_write_state (t, closure_list); if (!t->writing_active && !t->closed && grpc_chttp2_unlocking_check_writes (&t->global, &t->writing)) @@ -551,7 +551,7 @@ push_setting (grpc_chttp2_transport * t, grpc_chttp2_setting_id id, gpr_uint32 v } void -grpc_chttp2_terminate_writing (void *transport_writing_ptr, int success, grpc_closure_list * closure_list) +grpc_chttp2_terminate_writing (grpc_exec_ctx * exec_ctx, void *transport_writing_ptr, int success) { grpc_chttp2_transport_writing *transport_writing = transport_writing_ptr; grpc_chttp2_transport *t = TRANSPORT_FROM_WRITING (transport_writing); @@ -582,14 +582,14 @@ grpc_chttp2_terminate_writing (void *transport_writing_ptr, int success, grpc_cl } static void -writing_action (void *gt, int iomgr_success_ignored, grpc_closure_list * closure_list) +writing_action (grpc_exec_ctx * exec_ctx, void *gt, int iomgr_success_ignored) { grpc_chttp2_transport *t = gt; grpc_chttp2_perform_writes (&t->writing, t->ep, closure_list); } void -grpc_chttp2_add_incoming_goaway (grpc_chttp2_transport_global * transport_global, gpr_uint32 goaway_error, gpr_slice goaway_text, grpc_closure_list * closure_list) +grpc_chttp2_add_incoming_goaway (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global, gpr_uint32 goaway_error, gpr_slice goaway_text) { char *msg = gpr_dump_slice (goaway_text, GPR_DUMP_HEX | GPR_DUMP_ASCII); gpr_log (GPR_DEBUG, "got goaway [%d]: %s", goaway_error, msg); @@ -600,7 +600,7 @@ grpc_chttp2_add_incoming_goaway (grpc_chttp2_transport_global * transport_global } static void -maybe_start_some_streams (grpc_chttp2_transport_global * transport_global, grpc_closure_list * closure_list) +maybe_start_some_streams (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global) { grpc_chttp2_stream_global *stream_global; /* start streams where we have free grpc_chttp2_stream ids and free @@ -635,7 +635,7 @@ maybe_start_some_streams (grpc_chttp2_transport_global * transport_global, grpc_ } static void -perform_stream_op_locked (grpc_chttp2_transport_global * transport_global, grpc_chttp2_stream_global * stream_global, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +perform_stream_op_locked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global, grpc_chttp2_stream_global * stream_global, grpc_transport_stream_op * op) { if (op->cancel_with_status != GRPC_STATUS_OK) { @@ -711,7 +711,7 @@ perform_stream_op_locked (grpc_chttp2_transport_global * transport_global, grpc_ } static void -perform_stream_op (grpc_transport * gt, grpc_stream * gs, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +perform_stream_op (grpc_exec_ctx * exec_ctx, grpc_transport * gt, grpc_stream * gs, grpc_transport_stream_op * op) { grpc_chttp2_transport *t = (grpc_chttp2_transport *) gt; grpc_chttp2_stream *s = (grpc_chttp2_stream *) gs; @@ -741,7 +741,7 @@ send_ping_locked (grpc_chttp2_transport * t, grpc_closure * on_recv) } static void -perform_transport_op (grpc_transport * gt, grpc_transport_op * op, grpc_closure_list * closure_list) +perform_transport_op (grpc_exec_ctx * exec_ctx, grpc_transport * gt, grpc_transport_op * op) { grpc_chttp2_transport *t = (grpc_chttp2_transport *) gt; int close_transport = 0; @@ -815,7 +815,7 @@ compute_state (gpr_uint8 write_closed, gpr_uint8 read_closed) } static void -remove_stream (grpc_chttp2_transport * t, gpr_uint32 id, grpc_closure_list * closure_list) +remove_stream (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t, gpr_uint32 id) { size_t new_stream_count; grpc_chttp2_stream *s = grpc_chttp2_stream_map_delete (&t->parsing_stream_map, id); @@ -846,7 +846,7 @@ remove_stream (grpc_chttp2_transport * t, gpr_uint32 id, grpc_closure_list * clo } static void -unlock_check_read_write_state (grpc_chttp2_transport * t, grpc_closure_list * closure_list) +unlock_check_read_write_state (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t) { grpc_chttp2_transport_global *transport_global = &t->global; grpc_chttp2_stream_global *stream_global; @@ -1070,7 +1070,7 @@ end_all_the_calls (grpc_chttp2_transport * t) } static void -drop_connection (grpc_chttp2_transport * t, grpc_closure_list * closure_list) +drop_connection (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t) { close_transport_locked (t, closure_list); end_all_the_calls (t); @@ -1099,7 +1099,7 @@ update_global_window (void *args, gpr_uint32 id, void *stream) } static void -read_error_locked (grpc_chttp2_transport * t, grpc_closure_list * closure_list) +read_error_locked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t) { t->endpoint_reading = 0; if (!t->writing_active && t->ep) @@ -1110,7 +1110,7 @@ read_error_locked (grpc_chttp2_transport * t, grpc_closure_list * closure_list) /* tcp read callback */ static void -recv_data (void *tp, int success, grpc_closure_list * closure_list) +recv_data (grpc_exec_ctx * exec_ctx, void *tp, int success) { size_t i; int keep_reading = 0; @@ -1176,7 +1176,7 @@ recv_data (void *tp, int success, grpc_closure_list * closure_list) */ static void -connectivity_state_set (grpc_chttp2_transport_global * transport_global, grpc_connectivity_state state, const char *reason, grpc_closure_list * closure_list) +connectivity_state_set (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global, grpc_connectivity_state state, const char *reason) { GRPC_CHTTP2_IF_TRACING (gpr_log (GPR_DEBUG, "set connectivity_state=%d", state)); grpc_connectivity_state_set (&TRANSPORT_FROM_GLOBAL (transport_global)->channel_callback.state_tracker, state, reason, closure_list); @@ -1187,7 +1187,7 @@ connectivity_state_set (grpc_chttp2_transport_global * transport_global, grpc_co */ static void -add_to_pollset_locked (grpc_chttp2_transport * t, grpc_pollset * pollset, grpc_closure_list * closure_list) +add_to_pollset_locked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t, grpc_pollset * pollset) { if (t->ep) { @@ -1196,7 +1196,7 @@ add_to_pollset_locked (grpc_chttp2_transport * t, grpc_pollset * pollset, grpc_c } static void -add_to_pollset_set_locked (grpc_chttp2_transport * t, grpc_pollset_set * pollset_set, grpc_closure_list * closure_list) +add_to_pollset_set_locked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t, grpc_pollset_set * pollset_set) { if (t->ep) { @@ -1238,7 +1238,7 @@ grpc_chttp2_flowctl_trace (const char *file, int line, const char *reason, const */ static char * -chttp2_get_peer (grpc_transport * t, grpc_closure_list * closure_list) +chttp2_get_peer (grpc_exec_ctx * exec_ctx, grpc_transport * t) { return gpr_strdup (((grpc_chttp2_transport *) t)->peer_string); } @@ -1253,7 +1253,7 @@ static const grpc_transport_vtable vtable = { sizeof (grpc_chttp2_stream), }; grpc_transport * -grpc_create_chttp2_transport (const grpc_channel_args * channel_args, grpc_endpoint * ep, grpc_mdctx * mdctx, int is_client, grpc_closure_list * closure_list) +grpc_create_chttp2_transport (grpc_exec_ctx * exec_ctx, const grpc_channel_args * channel_args, grpc_endpoint * ep, grpc_mdctx * mdctx, int is_client) { grpc_chttp2_transport *t = gpr_malloc (sizeof (grpc_chttp2_transport)); init_transport (t, channel_args, ep, mdctx, is_client != 0, closure_list); @@ -1261,7 +1261,7 @@ grpc_create_chttp2_transport (const grpc_channel_args * channel_args, grpc_endpo } void -grpc_chttp2_transport_start_reading (grpc_transport * transport, gpr_slice * slices, size_t nslices, grpc_closure_list * closure_list) +grpc_chttp2_transport_start_reading (grpc_exec_ctx * exec_ctx, grpc_transport * transport, gpr_slice * slices, size_t nslices) { grpc_chttp2_transport *t = (grpc_chttp2_transport *) transport; REF_TRANSPORT (t, "recv_data"); /* matches unref inside recv_data */ diff --git a/src/core/transport/chttp2_transport.h b/src/core/transport/chttp2_transport.h index 69f98d3489..fe2f78a5ea 100644 --- a/src/core/transport/chttp2_transport.h +++ b/src/core/transport/chttp2_transport.h @@ -40,8 +40,8 @@ extern int grpc_http_trace; extern int grpc_flowctl_trace; -grpc_transport *grpc_create_chttp2_transport (const grpc_channel_args * channel_args, grpc_endpoint * ep, grpc_mdctx * metadata_context, int is_client, grpc_closure_list * closure_list); +grpc_transport *grpc_create_chttp2_transport (grpc_exec_ctx * exec_ctx, const grpc_channel_args * channel_args, grpc_endpoint * ep, grpc_mdctx * metadata_context, int is_client); -void grpc_chttp2_transport_start_reading (grpc_transport * transport, gpr_slice * slices, size_t nslices, grpc_closure_list * closure_list); +void grpc_chttp2_transport_start_reading (grpc_exec_ctx * exec_ctx, grpc_transport * transport, gpr_slice * slices, size_t nslices); #endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TRANSPORT_H */ diff --git a/src/core/transport/connectivity_state.c b/src/core/transport/connectivity_state.c index 08ecfb9fd5..76a69d1dab 100644 --- a/src/core/transport/connectivity_state.c +++ b/src/core/transport/connectivity_state.c @@ -70,7 +70,7 @@ grpc_connectivity_state_init (grpc_connectivity_state_tracker * tracker, grpc_co } void -grpc_connectivity_state_destroy (grpc_connectivity_state_tracker * tracker, grpc_closure_list * closure_list) +grpc_connectivity_state_destroy (grpc_exec_ctx * exec_ctx, grpc_connectivity_state_tracker * tracker) { int success; grpc_connectivity_state_watcher *w; @@ -104,7 +104,7 @@ grpc_connectivity_state_check (grpc_connectivity_state_tracker * tracker) } int -grpc_connectivity_state_notify_on_state_change (grpc_connectivity_state_tracker * tracker, grpc_connectivity_state * current, grpc_closure * notify, grpc_closure_list * closure_list) +grpc_connectivity_state_notify_on_state_change (grpc_exec_ctx * exec_ctx, grpc_connectivity_state_tracker * tracker, grpc_connectivity_state * current, grpc_closure * notify) { if (grpc_connectivity_state_trace) { @@ -127,7 +127,7 @@ grpc_connectivity_state_notify_on_state_change (grpc_connectivity_state_tracker } void -grpc_connectivity_state_set (grpc_connectivity_state_tracker * tracker, grpc_connectivity_state state, const char *reason, grpc_closure_list * closure_list) +grpc_connectivity_state_set (grpc_exec_ctx * exec_ctx, grpc_connectivity_state_tracker * tracker, grpc_connectivity_state state, const char *reason) { grpc_connectivity_state_watcher *w; if (grpc_connectivity_state_trace) diff --git a/src/core/transport/connectivity_state.h b/src/core/transport/connectivity_state.h index 81fc8e7e12..38742834fb 100644 --- a/src/core/transport/connectivity_state.h +++ b/src/core/transport/connectivity_state.h @@ -60,15 +60,15 @@ typedef struct extern int grpc_connectivity_state_trace; void grpc_connectivity_state_init (grpc_connectivity_state_tracker * tracker, grpc_connectivity_state init_state, const char *name); -void grpc_connectivity_state_destroy (grpc_connectivity_state_tracker * tracker, grpc_closure_list * closure_list); +void grpc_connectivity_state_destroy (grpc_exec_ctx * exec_ctx, grpc_connectivity_state_tracker * tracker); /** Set connectivity state; not thread safe; access must be serialized with an * external lock */ -void grpc_connectivity_state_set (grpc_connectivity_state_tracker * tracker, grpc_connectivity_state state, const char *reason, grpc_closure_list * closure_list); +void grpc_connectivity_state_set (grpc_exec_ctx * exec_ctx, grpc_connectivity_state_tracker * tracker, grpc_connectivity_state state, const char *reason); grpc_connectivity_state grpc_connectivity_state_check (grpc_connectivity_state_tracker * tracker); /** Return 1 if the channel should start connecting, 0 otherwise */ -int grpc_connectivity_state_notify_on_state_change (grpc_connectivity_state_tracker * tracker, grpc_connectivity_state * current, grpc_closure * notify, grpc_closure_list * closure_list); +int grpc_connectivity_state_notify_on_state_change (grpc_exec_ctx * exec_ctx, grpc_connectivity_state_tracker * tracker, grpc_connectivity_state * current, grpc_closure * notify); #endif /* GRPC_INTERNAL_CORE_TRANSPORT_CONNECTIVITY_STATE_H */ diff --git a/src/core/transport/transport.c b/src/core/transport/transport.c index 1288d6d04d..ca04d34b3f 100644 --- a/src/core/transport/transport.c +++ b/src/core/transport/transport.c @@ -43,43 +43,43 @@ grpc_transport_stream_size (grpc_transport * transport) } void -grpc_transport_destroy (grpc_transport * transport, grpc_closure_list * closure_list) +grpc_transport_destroy (grpc_exec_ctx * exec_ctx, grpc_transport * transport) { transport->vtable->destroy (transport, closure_list); } int -grpc_transport_init_stream (grpc_transport * transport, grpc_stream * stream, const void *server_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list) +grpc_transport_init_stream (grpc_exec_ctx * exec_ctx, grpc_transport * transport, grpc_stream * stream, const void *server_data, grpc_transport_stream_op * initial_op) { return transport->vtable->init_stream (transport, stream, server_data, initial_op, closure_list); } void -grpc_transport_perform_stream_op (grpc_transport * transport, grpc_stream * stream, grpc_transport_stream_op * op, grpc_closure_list * closure_list) +grpc_transport_perform_stream_op (grpc_exec_ctx * exec_ctx, grpc_transport * transport, grpc_stream * stream, grpc_transport_stream_op * op) { transport->vtable->perform_stream_op (transport, stream, op, closure_list); } void -grpc_transport_perform_op (grpc_transport * transport, grpc_transport_op * op, grpc_closure_list * closure_list) +grpc_transport_perform_op (grpc_exec_ctx * exec_ctx, grpc_transport * transport, grpc_transport_op * op) { transport->vtable->perform_op (transport, op, closure_list); } void -grpc_transport_destroy_stream (grpc_transport * transport, grpc_stream * stream, grpc_closure_list * closure_list) +grpc_transport_destroy_stream (grpc_exec_ctx * exec_ctx, grpc_transport * transport, grpc_stream * stream) { transport->vtable->destroy_stream (transport, stream, closure_list); } char * -grpc_transport_get_peer (grpc_transport * transport, grpc_closure_list * closure_list) +grpc_transport_get_peer (grpc_exec_ctx * exec_ctx, grpc_transport * transport) { return transport->vtable->get_peer (transport, closure_list); } void -grpc_transport_stream_op_finish_with_failure (grpc_transport_stream_op * op, grpc_closure_list * closure_list) +grpc_transport_stream_op_finish_with_failure (grpc_exec_ctx * exec_ctx, grpc_transport_stream_op * op) { grpc_closure_list_add (closure_list, op->on_done_recv, 0); grpc_closure_list_add (closure_list, op->on_done_send, 0); @@ -113,7 +113,7 @@ typedef struct } close_message_data; static void -free_message (void *p, int iomgr_success, grpc_closure_list * closure_list) +free_message (grpc_exec_ctx * exec_ctx, void *p, int iomgr_success) { close_message_data *cmd = p; gpr_slice_unref (cmd->message); diff --git a/src/core/transport/transport.h b/src/core/transport/transport.h index c28dc0c2a6..80d842b4be 100644 --- a/src/core/transport/transport.h +++ b/src/core/transport/transport.h @@ -136,7 +136,7 @@ size_t grpc_transport_stream_size (grpc_transport * transport); stream - a pointer to uninitialized memory to initialize server_data - either NULL for a client initiated stream, or a pointer supplied from the accept_stream callback function */ -int grpc_transport_init_stream (grpc_transport * transport, grpc_stream * stream, const void *server_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list); +int grpc_transport_init_stream (grpc_exec_ctx * exec_ctx, grpc_transport * transport, grpc_stream * stream, const void *server_data, grpc_transport_stream_op * initial_op); /* Destroy transport data for a stream. @@ -148,9 +148,9 @@ int grpc_transport_init_stream (grpc_transport * transport, grpc_stream * stream transport - the transport on which to create this stream stream - the grpc_stream to destroy (memory is still owned by the caller, but any child memory must be cleaned up) */ -void grpc_transport_destroy_stream (grpc_transport * transport, grpc_stream * stream, grpc_closure_list * closure_list); +void grpc_transport_destroy_stream (grpc_exec_ctx * exec_ctx, grpc_transport * transport, grpc_stream * stream); -void grpc_transport_stream_op_finish_with_failure (grpc_transport_stream_op * op, grpc_closure_list * closure_list); +void grpc_transport_stream_op_finish_with_failure (grpc_exec_ctx * exec_ctx, grpc_transport_stream_op * op); void grpc_transport_stream_op_add_cancellation (grpc_transport_stream_op * op, grpc_status_code status); @@ -167,9 +167,9 @@ char *grpc_transport_stream_op_string (grpc_transport_stream_op * op); stream - the stream on which to send the operations. This must be non-NULL and previously initialized by the same transport. op - a grpc_transport_stream_op specifying the op to perform */ -void grpc_transport_perform_stream_op (grpc_transport * transport, grpc_stream * stream, grpc_transport_stream_op * op, grpc_closure_list * closure_list); +void grpc_transport_perform_stream_op (grpc_exec_ctx * exec_ctx, grpc_transport * transport, grpc_stream * stream, grpc_transport_stream_op * op); -void grpc_transport_perform_op (grpc_transport * transport, grpc_transport_op * op, grpc_closure_list * closure_list); +void grpc_transport_perform_op (grpc_exec_ctx * exec_ctx, grpc_transport * transport, grpc_transport_op * op); /* Send a ping on a transport @@ -183,9 +183,9 @@ void grpc_transport_goaway (grpc_transport * transport, grpc_status_code status, void grpc_transport_close (grpc_transport * transport); /* Destroy the transport */ -void grpc_transport_destroy (grpc_transport * transport, grpc_closure_list * closure_list); +void grpc_transport_destroy (grpc_exec_ctx * exec_ctx, grpc_transport * transport); /* Get the transports peer */ -char *grpc_transport_get_peer (grpc_transport * transport, grpc_closure_list * closure_list); +char *grpc_transport_get_peer (grpc_exec_ctx * exec_ctx, grpc_transport * transport); #endif /* GRPC_INTERNAL_CORE_TRANSPORT_TRANSPORT_H */ diff --git a/src/core/transport/transport_impl.h b/src/core/transport/transport_impl.h index 97f4c4c8c7..54ebc24ff3 100644 --- a/src/core/transport/transport_impl.h +++ b/src/core/transport/transport_impl.h @@ -43,22 +43,22 @@ typedef struct grpc_transport_vtable size_t sizeof_stream; /* = sizeof(transport stream) */ /* implementation of grpc_transport_init_stream */ - int (*init_stream) (grpc_transport * self, grpc_stream * stream, const void *server_data, grpc_transport_stream_op * initial_op, grpc_closure_list * closure_list); + int (*init_stream) (grpc_exec_ctx * exec_ctx, grpc_transport * self, grpc_stream * stream, const void *server_data, grpc_transport_stream_op * initial_op); /* implementation of grpc_transport_perform_stream_op */ - void (*perform_stream_op) (grpc_transport * self, grpc_stream * stream, grpc_transport_stream_op * op, grpc_closure_list * closure_list); + void (*perform_stream_op) (grpc_exec_ctx * exec_ctx, grpc_transport * self, grpc_stream * stream, grpc_transport_stream_op * op); /* implementation of grpc_transport_perform_op */ - void (*perform_op) (grpc_transport * self, grpc_transport_op * op, grpc_closure_list * closure_list); + void (*perform_op) (grpc_exec_ctx * exec_ctx, grpc_transport * self, grpc_transport_op * op); /* implementation of grpc_transport_destroy_stream */ - void (*destroy_stream) (grpc_transport * self, grpc_stream * stream, grpc_closure_list * closure_list); + void (*destroy_stream) (grpc_exec_ctx * exec_ctx, grpc_transport * self, grpc_stream * stream); /* implementation of grpc_transport_destroy */ - void (*destroy) (grpc_transport * self, grpc_closure_list * closure_list); + void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_transport * self); /* implementation of grpc_transport_get_peer */ - char *(*get_peer) (grpc_transport * self, grpc_closure_list * closure_list); + char *(*get_peer) (grpc_exec_ctx * exec_ctx, grpc_transport * self); } grpc_transport_vtable; /* an instance of a grpc transport */ |