Go to the documentation of this file.
19 #ifndef GRPC_CORE_LIB_IOMGR_CALL_COMBINER_H
20 #define GRPC_CORE_LIB_IOMGR_CALL_COMBINER_H
55 #define GRPC_CALL_COMBINER_START(call_combiner, closure, error, reason) \
56 (call_combiner)->Start((closure), (error), __FILE__, __LINE__, (reason))
57 #define GRPC_CALL_COMBINER_STOP(call_combiner, reason) \
58 (call_combiner)->Stop(__FILE__, __LINE__, (reason))
61 int line,
const char* reason);
63 void Stop(
const char* file,
int line,
const char* reason);
65 #define GRPC_CALL_COMBINER_START(call_combiner, closure, error, reason) \
66 (call_combiner)->Start((closure), (error), (reason))
67 #define GRPC_CALL_COMBINER_STOP(call_combiner, reason) \
68 (call_combiner)->Stop((reason))
72 void Stop(
const char* reason);
107 #ifdef GRPC_TSAN_ENABLED
108 static void TsanClosure(
void* arg,
grpc_error* error);
117 #ifdef GRPC_TSAN_ENABLED
125 struct TsanLock :
public RefCounted<TsanLock, NonPolymorphicRefCount> {
131 std::atomic<bool> taken{
false};
133 RefCountedPtr<TsanLock> tsan_lock_ = MakeRefCounted<TsanLock>();
164 if (closures_.
empty()) {
168 for (
size_t i = 1; i < closures_.
size(); ++i) {
169 auto& closure = closures_[i];
175 "CallCombinerClosureList executing closure while already "
176 "holding call_combiner %p: closure=%p error=%s reason=%s",
177 call_combiner, closures_[0].closure,
188 for (
size_t i = 0; i < closures_.
size(); ++i) {
189 auto& closure = closures_[i];
199 struct CallCombinerClosure {
206 : closure(closure), error(error), reason(reason) {}
211 InlinedVector<CallCombinerClosure, 6> closures_;
#define TSAN_ANNOTATE_RWLOCK_CREATE(addr)
Definition: dynamic_annotations.h:60
#define GPR_INFO
Definition: log.h:56
size_t size() const
Definition: call_combiner.h:196
void RunClosures(CallCombiner *call_combiner)
Definition: call_combiner.h:163
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
Log a message.
Definition: call_combiner.h:146
CallCombinerClosureList()
Definition: call_combiner.h:148
Internal thread interface.
Definition: backoff.h:26
Definition: call_combiner.h:49
Definition: ref_counted.h:248
void RunClosuresWithoutYielding(CallCombiner *call_combiner)
Definition: call_combiner.h:187
#define GRPC_TRACE_FLAG_ENABLED(f)
Definition: trace.h:112
void Cancel(grpc_error *error)
Indicates that the call has been cancelled.
void Stop(const char *file, int line, const char *reason)
Yields the call combiner to the next closure in the queue, if any.
#define DEBUG_LOCATION
Definition: debug_location.h:41
void Add(grpc_closure *closure, grpc_error *error, const char *reason)
Definition: call_combiner.h:152
void Start(grpc_closure *closure, grpc_error *error, const char *file, int line, const char *reason)
Starts processing closure.
#define GRPC_CALL_COMBINER_STOP(call_combiner, reason)
Definition: call_combiner.h:57
bool empty() const
Definition: inlined_vector.h:166
static void Run(const DebugLocation &location, grpc_closure *closure, grpc_error *error)
#define GRPC_CALL_COMBINER_START(call_combiner, closure, error, reason)
Definition: call_combiner.h:55
DebugOnlyTraceFlag grpc_call_combiner_trace
void SetNotifyOnCancel(grpc_closure *closure)
Registers closure to be invoked when Cancel() is called.
intptr_t gpr_atm
Definition: atm_gcc_atomic.h:30
size_t size() const
Definition: inlined_vector.h:165
const char * grpc_error_string(grpc_error *error)
#define TSAN_ANNOTATE_RWLOCK_DESTROY(addr)
Definition: dynamic_annotations.h:61
void emplace_back(Args &&... args)
Definition: inlined_vector.h:145
Definition: error_internal.h:39
void clear()
Definition: inlined_vector.h:170
A closure over a grpc_iomgr_cb_func.
Definition: closure.h:56
TraceFlag DebugOnlyTraceFlag
Definition: trace.h:115