summaryrefslogtreecommitdiff
path: root/grpc/src/core/lib/iomgr/call_combiner.h
diff options
context:
space:
mode:
Diffstat (limited to 'grpc/src/core/lib/iomgr/call_combiner.h')
-rw-r--r--grpc/src/core/lib/iomgr/call_combiner.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/grpc/src/core/lib/iomgr/call_combiner.h b/grpc/src/core/lib/iomgr/call_combiner.h
index 44acd9fe..e5429cca 100644
--- a/grpc/src/core/lib/iomgr/call_combiner.h
+++ b/grpc/src/core/lib/iomgr/call_combiner.h
@@ -58,7 +58,7 @@ class CallCombiner {
#define GRPC_CALL_COMBINER_STOP(call_combiner, reason) \
(call_combiner)->Stop(__FILE__, __LINE__, (reason))
/// Starts processing \a closure.
- void Start(grpc_closure* closure, grpc_error* error, const char* file,
+ void Start(grpc_closure* closure, grpc_error_handle error, const char* file,
int line, const char* reason);
/// Yields the call combiner to the next closure in the queue, if any.
void Stop(const char* file, int line, const char* reason);
@@ -68,7 +68,8 @@ class CallCombiner {
#define GRPC_CALL_COMBINER_STOP(call_combiner, reason) \
(call_combiner)->Stop((reason))
/// Starts processing \a closure.
- void Start(grpc_closure* closure, grpc_error* error, const char* reason);
+ void Start(grpc_closure* closure, grpc_error_handle error,
+ const char* reason);
/// Yields the call combiner to the next closure in the queue, if any.
void Stop(const char* reason);
#endif
@@ -94,26 +95,22 @@ class CallCombiner {
/// cancellation; this effectively unregisters the previously set closure.
/// However, most filters will not need to explicitly unregister their
/// callbacks, as this is done automatically when the call is destroyed.
- /// Filters that schedule the cancellation closure on ExecCtx do not need
- /// to take a ref on the call stack to guarantee closure liveness. This is
- /// done by explicitly flushing ExecCtx after the unregistration during
- /// call destruction.
void SetNotifyOnCancel(grpc_closure* closure);
/// Indicates that the call has been cancelled.
- void Cancel(grpc_error* error);
+ void Cancel(grpc_error_handle error);
private:
- void ScheduleClosure(grpc_closure* closure, grpc_error* error);
+ void ScheduleClosure(grpc_closure* closure, grpc_error_handle error);
#ifdef GRPC_TSAN_ENABLED
- static void TsanClosure(void* arg, grpc_error* error);
+ static void TsanClosure(void* arg, grpc_error_handle error);
#endif
gpr_atm size_ = 0; // size_t, num closures in queue or currently executing
MultiProducerSingleConsumerQueue queue_;
// Either 0 (if not cancelled and no cancellation closure set),
// a grpc_closure* (if the lowest bit is 0),
- // or a grpc_error* (if the lowest bit is 1).
+ // or a grpc_error_handle (if the lowest bit is 1).
gpr_atm cancel_state_ = 0;
#ifdef GRPC_TSAN_ENABLED
// A fake ref-counted lock that is kept alive after the destruction of
@@ -150,7 +147,7 @@ class CallCombinerClosureList {
// Adds a closure to the list. The closure must eventually result in
// the call combiner being yielded.
- void Add(grpc_closure* closure, grpc_error* error, const char* reason) {
+ void Add(grpc_closure* closure, grpc_error_handle error, const char* reason) {
closures_.emplace_back(closure, error, reason);
}
@@ -176,7 +173,8 @@ class CallCombinerClosureList {
"CallCombinerClosureList executing closure while already "
"holding call_combiner %p: closure=%p error=%s reason=%s",
call_combiner, closures_[0].closure,
- grpc_error_string(closures_[0].error), closures_[0].reason);
+ grpc_error_std_string(closures_[0].error).c_str(),
+ closures_[0].reason);
}
// This will release the call combiner.
ExecCtx::Run(DEBUG_LOCATION, closures_[0].closure, closures_[0].error);
@@ -199,10 +197,10 @@ class CallCombinerClosureList {
private:
struct CallCombinerClosure {
grpc_closure* closure;
- grpc_error* error;
+ grpc_error_handle error;
const char* reason;
- CallCombinerClosure(grpc_closure* closure, grpc_error* error,
+ CallCombinerClosure(grpc_closure* closure, grpc_error_handle error,
const char* reason)
: closure(closure), error(error), reason(reason) {}
};