Classes | Namespaces | Macros | Typedefs | Functions | Variables
closure.h File Reference
#include <grpc/support/port_platform.h>
#include <assert.h>
#include <stdbool.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/profiling/timers.h"
Include dependency graph for closure.h:

Go to the source code of this file.

Classes

class  grpc_core::Closure
 
struct  grpc_closure
 
struct  grpc_closure_list
 
struct  closure_impl::wrapped_closure
 

Namespaces

 closure_impl
 
 grpc_core
 

Macros

#define GRPC_CLOSURE_CREATE(cb, cb_arg, scheduler)   grpc_closure_create(__FILE__, __LINE__, cb, cb_arg)
 
#define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler)   grpc_closure_init(__FILE__, __LINE__, closure, cb, cb_arg)
 
#define GRPC_CLOSURE_LIST_INIT   { nullptr, nullptr }
 

Typedefs

typedef struct grpc_closure grpc_closure
 
typedef struct grpc_closure_list grpc_closure_list
 
typedef void(* grpc_iomgr_cb_func) (void *arg, grpc_error_handle error)
 

Functions

void closure_impl::closure_wrapper (void *arg, grpc_error_handle error)
 
grpc_closuregrpc_closure_create (const char *file, int line, grpc_iomgr_cb_func cb, void *cb_arg)
 
grpc_closuregrpc_closure_init (const char *file, int line, grpc_closure *closure, grpc_iomgr_cb_func cb, void *cb_arg)
 
bool grpc_closure_list_append (grpc_closure_list *closure_list, grpc_closure *closure)
 
bool grpc_closure_list_append (grpc_closure_list *closure_list, grpc_closure *closure, grpc_error_handle error)
 
bool grpc_closure_list_empty (grpc_closure_list closure_list)
 
void grpc_closure_list_fail_all (grpc_closure_list *list, grpc_error_handle forced_failure)
 
void grpc_closure_list_init (grpc_closure_list *closure_list)
 
void grpc_closure_list_move (grpc_closure_list *src, grpc_closure_list *dst)
 

Variables

grpc_core::DebugOnlyTraceFlag grpc_trace_closure
 

Macro Definition Documentation

◆ GRPC_CLOSURE_CREATE

#define GRPC_CLOSURE_CREATE (   cb,
  cb_arg,
  scheduler 
)    grpc_closure_create(__FILE__, __LINE__, cb, cb_arg)

Definition at line 160 of file closure.h.

◆ GRPC_CLOSURE_INIT

#define GRPC_CLOSURE_INIT (   closure,
  cb,
  cb_arg,
  scheduler 
)    grpc_closure_init(__FILE__, __LINE__, closure, cb, cb_arg)

Initializes closure with cb and cb_arg. Returns closure.

Definition at line 115 of file closure.h.

◆ GRPC_CLOSURE_LIST_INIT

#define GRPC_CLOSURE_LIST_INIT   { nullptr, nullptr }

Definition at line 167 of file closure.h.

Typedef Documentation

◆ grpc_closure

typedef struct grpc_closure grpc_closure

Definition at line 37 of file closure.h.

◆ grpc_closure_list

◆ grpc_iomgr_cb_func

typedef void(* grpc_iomgr_cb_func) (void *arg, grpc_error_handle error)

gRPC Callback definition.

Parameters
argArbitrary input.
errorGRPC_ERROR_NONE if no error occurred, otherwise some grpc_error describing what went wrong. Error contract: it is not the cb's job to unref this error; the closure scheduler will do that after the cb returns

Definition at line 53 of file closure.h.

Function Documentation

◆ grpc_closure_create()

grpc_closure* grpc_closure_create ( const char *  file,
int  line,
grpc_iomgr_cb_func  cb,
void *  cb_arg 
)
inline

Definition at line 140 of file closure.h.

◆ grpc_closure_init()

grpc_closure* grpc_closure_init ( const char *  file,
int  line,
grpc_closure closure,
grpc_iomgr_cb_func  cb,
void *  cb_arg 
)
inline

Definition at line 92 of file closure.h.

◆ grpc_closure_list_append() [1/2]

bool grpc_closure_list_append ( grpc_closure_list closure_list,
grpc_closure closure 
)
inline

add closure to the end of list Returns true if list becomes non-empty

Definition at line 176 of file closure.h.

◆ grpc_closure_list_append() [2/2]

bool grpc_closure_list_append ( grpc_closure_list closure_list,
grpc_closure closure,
grpc_error_handle  error 
)
inline

add closure to the end of list and set closure's result to error Returns true if list becomes non-empty

Definition at line 195 of file closure.h.

◆ grpc_closure_list_empty()

bool grpc_closure_list_empty ( grpc_closure_list  closure_list)
inline

return whether list is empty.

Definition at line 243 of file closure.h.

◆ grpc_closure_list_fail_all()

void grpc_closure_list_fail_all ( grpc_closure_list list,
grpc_error_handle  forced_failure 
)
inline

force all success bits in list to false

Definition at line 211 of file closure.h.

◆ grpc_closure_list_init()

void grpc_closure_list_init ( grpc_closure_list closure_list)
inline

Definition at line 170 of file closure.h.

◆ grpc_closure_list_move()

void grpc_closure_list_move ( grpc_closure_list src,
grpc_closure_list dst 
)
inline

append all closures from src to dst and empty src.

Definition at line 228 of file closure.h.

Variable Documentation

◆ grpc_trace_closure

grpc_core::DebugOnlyTraceFlag grpc_trace_closure


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:07