// // // Copyright 2017 gRPC authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // #ifndef GRPC_SRC_CORE_LIB_IOMGR_CALL_COMBINER_H #define GRPC_SRC_CORE_LIB_IOMGR_CALL_COMBINER_H #include <grpc/support/port_platform.h> #include <stddef.h> #include "absl/container/inlined_vector.h" #include <grpc/support/atm.h> #include "src/core/lib/gprpp/mpscq.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/dynamic_annotations.h" #include "src/core/lib/iomgr/exec_ctx.h" // A simple, lock-free mechanism for serializing activity related to a // single call. This is similar to a combiner but is more lightweight. // // It requires the callback (or, in the common case where the callback // actually kicks off a chain of callbacks, the last callback in that // chain) to explicitly indicate (by calling GRPC_CALL_COMBINER_STOP()) // when it is done with the action that was kicked off by the original // callback. namespace grpc_core { extern DebugOnlyTraceFlag grpc_call_combiner_trace; class CallCombiner { … }; // Helper for running a list of closures in a call combiner. // // Each callback running in the call combiner will eventually be // returned to the surface, at which point the surface will yield the // call combiner. So when we are running in the call combiner and have // more than one callback to return to the surface, we need to re-enter // the call combiner for all but one of those callbacks. class CallCombinerClosureList { … }; } // namespace grpc_core #endif // GRPC_SRC_CORE_LIB_IOMGR_CALL_COMBINER_H