19 #ifndef GRPC_CORE_LIB_IOMGR_CLOSURE_H
20 #define GRPC_CORE_LIB_IOMGR_CLOSURE_H
115 #define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler) \
116 grpc_closure_init(__FILE__, __LINE__, closure, cb, cb_arg)
118 #define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler) \
119 grpc_closure_init(closure, cb, cb_arg)
132 void* cb_arg = wc->
cb_arg;
160 #define GRPC_CLOSURE_CREATE(cb, cb_arg, scheduler) \
161 grpc_closure_create(__FILE__, __LINE__, cb, cb_arg)
163 #define GRPC_CLOSURE_CREATE(cb, cb_arg, scheduler) \
164 grpc_closure_create(cb, cb_arg)
167 #define GRPC_CLOSURE_LIST_INIT \
171 closure_list->
head = closure_list->
tail =
nullptr;
186 bool was_empty = (closure_list->
head ==
nullptr);
210 if (src->
head ==
nullptr) {
213 if (dst->
head ==
nullptr) {
224 return closure_list.
head ==
nullptr;
Definition: closure.h:228
static void Run(const DebugLocation &location, grpc_closure *closure, grpc_error_handle error)
Definition: closure.h:230
Definition: debug_location.h:31
int line() const
Definition: debug_location.h:35
const char * file() const
Definition: debug_location.h:34
Definition: manual_constructor.h:169
bool enabled()
Definition: trace.h:80
bool grpc_closure_list_empty(grpc_closure_list closure_list)
return whether list is empty.
Definition: closure.h:223
struct grpc_closure_list grpc_closure_list
grpc_core::DebugOnlyTraceFlag grpc_trace_closure
void grpc_closure_list_move(grpc_closure_list *src, grpc_closure_list *dst)
append all closures from src to dst and empty src.
Definition: closure.h:208
grpc_closure * grpc_closure_init(const char *file, int line, grpc_closure *closure, grpc_iomgr_cb_func cb, void *cb_arg)
Definition: closure.h:92
grpc_closure * grpc_closure_create(const char *file, int line, grpc_iomgr_cb_func cb, void *cb_arg)
Definition: closure.h:140
void grpc_closure_list_fail_all(grpc_closure_list *list, grpc_error_handle forced_failure)
force all success bits in list to false
Definition: closure.h:197
bool grpc_closure_list_append(grpc_closure_list *closure_list, grpc_closure *closure, grpc_error_handle error)
add closure to the end of list and set closure's result to error Returns true if list becomes non-emp...
Definition: closure.h:177
void grpc_closure_list_init(grpc_closure_list *closure_list)
Definition: closure.h:170
void(* grpc_iomgr_cb_func)(void *arg, grpc_error_handle error)
gRPC Callback definition.
Definition: closure.h:53
#define GRPC_ERROR_NONE
The following "special" errors can be propagated without allocating memory.
Definition: error.h:228
#define GRPC_ERROR_UNREF(err)
Definition: error.h:254
#define GRPC_ERROR_REF(err)
Definition: error.h:253
#define GPR_DEBUG
Macros to build log contexts at various severity levels.
Definition: log.h:53
#define GPR_ASSERT(x)
abort() the process if x is zero, having written a line to the log.
Definition: log.h:92
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
Log a message.
GPRAPI void gpr_free(void *ptr)
free
Definition: alloc.cc:50
GPRAPI void * gpr_malloc(size_t size)
malloc.
Definition: alloc.cc:28
grpc_error_handle error
Definition: lame_client.cc:54
Definition: closure.h:122
void closure_wrapper(void *arg, grpc_error_handle error)
Definition: closure.h:129
Round Robin Policy.
Definition: backend_metric.cc:26
grpc_closure closure
Definition: server.cc:460
Definition: closure.h:124
grpc_iomgr_cb_func cb
Definition: closure.h:125
grpc_closure wrapper
Definition: closure.h:127
void * cb_arg
Definition: closure.h:126
grpc_closure * tail
Definition: closure.h:43
grpc_closure * head
Definition: closure.h:42
A closure over a grpc_iomgr_cb_func.
Definition: closure.h:56
bool scheduled
Definition: closure.h:82
int line_initiated
Definition: closure.h:87
bool run
Definition: closure.h:83
void * cb_arg
Arguments to be passed to "cb".
Definition: closure.h:71
grpc_closure * next
Definition: closure.h:60
uintptr_t scratch
Definition: closure.h:64
union grpc_closure::@23 error_data
Once queued, the result of the closure.
union grpc_closure::@22 next_data
Once queued, next indicates the next queued closure; before then, scratch space.
const char * file_created
Definition: closure.h:84
int line_created
Definition: closure.h:85
grpc_error_handle error
Definition: closure.h:75
grpc_core::ManualConstructor< grpc_core::MultiProducerSingleConsumerQueue::Node > mpscq_node
Definition: closure.h:63
const char * file_initiated
Definition: closure.h:86
grpc_iomgr_cb_func cb
Bound callback.
Definition: closure.h:68
Definition: error_internal.h:41