Go to the documentation of this file.
20 #include "absl/base/thread_annotations.h"
49 struct CallbackAlternativeCQ {
52 std::vector<grpc_core::Thread>* nexting_threads
55 CompletionQueue*
Ref() {
59 cq =
new CompletionQueue;
60 int num_nexting_threads =
62 nexting_threads =
new std::vector<grpc_core::Thread>;
63 for (
int i = 0;
i < num_nexting_threads;
i++) {
64 nexting_threads->emplace_back(
68 static_cast<CompletionQueue*
>(
arg)->
cq();
103 for (
auto& th : *nexting_threads) {
115 for (
auto& th : *nexting_threads) {
118 delete nexting_threads;
124 CallbackAlternativeCQ g_callback_alternative_cq;
142 "CompletionQueue shutdown being shutdown before its server.");
160 *
ok = ev.success != 0;
162 if (core_cq_tag->FinalizeResult(
tag,
ok)) {
189 if (core_cq_tag->FinalizeResult(
tag,
ok)) {
199 return g_callback_alternative_cq.Ref();
208 g_callback_alternative_cq.Unref();
grpc_completion_queue * cq_
GPRAPI unsigned gpr_cpu_num_cores(void)
@ SHUTDOWN
The completion queue has been shutdown and fully-drained.
#define GPR_DEBUG_ASSERT(x)
CompletionQueueTLSCache(CompletionQueue *cq)
void CompleteAvalanching()
static grpc::internal::GrpcLibraryInitializer g_gli_initializer
GRPCAPI int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue *cq, void **tag, int *ok)
NextStatus
Tri-state return for AsyncNext: SHUTDOWN, GOT_EVENT, TIMEOUT.
#define ABSL_GUARDED_BY(x)
Classes that require gRPC to be initialized should inherit from this class.
GPRAPI void gpr_once_init(gpr_once *once, void(*init_function)(void))
GRPCAPI void grpc_completion_queue_thread_local_cache_init(grpc_completion_queue *cq)
std::vector< CordRep * > refs
grpc_completion_queue * cq_
grpc_completion_queue * cq()
void(* functor_run)(struct grpc_completion_queue_functor *, int)
static void * tag(intptr_t t)
static void ReleaseCallbackAlternativeCQ(CompletionQueue *cq)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
GPRAPI void gpr_sleep_until(gpr_timespec until)
static CompletionQueue * CallbackAlternativeCQ()
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
T Clamp(T val, T min, T max)
GPRAPI gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b)
~CompletionQueueTLSCache()
bool ServerListEmpty() const
bool Flush(void **tag, bool *ok)
@ TIMEOUT
deadline was reached.
GRPCAPI grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved)
void InitialAvalanching()
GPRAPI gpr_timespec gpr_time_from_millis(int64_t ms, gpr_clock_type clock_type)
An interface allowing implementors to process and filter event tags.
internal::RefMatcher< T & > Ref(T &x)
NextStatus AsyncNextInternal(void **tag, bool *ok, gpr_timespec deadline)
static grpc_completion_queue * cq
#define ABSL_NO_THREAD_SAFETY_ANALYSIS
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:52