#ifndef GRPC_SRC_CORE_LIB_IOMGR_CLOSURE_H
#define GRPC_SRC_CORE_LIB_IOMGR_CLOSURE_H
#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/crash.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"
struct grpc_closure;
grpc_closure;
extern grpc_core::DebugOnlyTraceFlag grpc_trace_closure;
grpc_closure_list;
grpc_iomgr_cb_func;
struct grpc_closure { … };
#ifndef NDEBUG
inline grpc_closure* grpc_closure_init(const char* file, int line,
grpc_closure* closure,
grpc_iomgr_cb_func cb, void* cb_arg) { … }
#ifndef NDEBUG
#define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler) …
#else
#define GRPC_CLOSURE_INIT …
#endif
namespace grpc_core {
template <typename T, void (T::*cb)(grpc_error_handle)>
grpc_closure MakeMemberClosure(T* p, DebugLocation location = DebugLocation()) { … }
template <typename T, void (T::*cb)()>
grpc_closure MakeMemberClosure(T* p, DebugLocation location = DebugLocation()) { … }
template <typename F>
grpc_closure* NewClosure(F f) { … }
}
namespace closure_impl {
struct wrapped_closure { … };
inline void closure_wrapper(void* arg, grpc_error_handle error) { … }
}
#ifndef NDEBUG
inline grpc_closure* grpc_closure_create(const char* file, int line,
grpc_iomgr_cb_func cb, void* cb_arg) { … }
#ifndef NDEBUG
#define GRPC_CLOSURE_CREATE(cb, cb_arg, scheduler) …
#else
#define GRPC_CLOSURE_CREATE …
#endif
#define GRPC_CLOSURE_LIST_INIT …
inline void grpc_closure_list_init(grpc_closure_list* closure_list) { … }
inline bool grpc_closure_list_append(grpc_closure_list* closure_list,
grpc_closure* closure) { … }
inline bool grpc_closure_list_append(grpc_closure_list* closure_list,
grpc_closure* closure,
grpc_error_handle error) { … }
inline void grpc_closure_list_fail_all(grpc_closure_list* list,
grpc_error_handle forced_failure) { … }
inline void grpc_closure_list_move(grpc_closure_list* src,
grpc_closure_list* dst) { … }
inline bool grpc_closure_list_empty(grpc_closure_list closure_list) { … }
namespace grpc_core {
class Closure { … };
}
#endif