Go to the documentation of this file.
32 #define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
36 return reinterpret_cast<void*
>(++
i);
82 attr.cq_completion_type = completion_types[
i];
83 attr.cq_polling_type = polling_types[j];
102 attr.cq_completion_type = completion_types[
i];
103 attr.cq_polling_type = polling_types[j];
124 attr.cq_polling_type = polling_types[
i];
152 attr.cq_polling_type = polling_types[
i];
187 attr.cq_polling_type = polling_types[
i];
221 LOG_TEST(
"test_cq_tls_cache_empty");
227 attr.cq_polling_type = polling_types[
i];
246 LOG_TEST(
"test_shutdown_then_next_polling");
251 attr.cq_polling_type = polling_types[
i];
268 LOG_TEST(
"test_shutdown_then_next_with_timeout");
273 attr.cq_polling_type = polling_types[
i];
299 for (j = 0; j <
i; j++) {
306 for (
size_t pidx = 0; pidx <
GPR_ARRAY_SIZE(polling_types); pidx++) {
308 attr.cq_polling_type = polling_types[pidx];
315 nullptr, &completions[
i]);
327 nullptr, &completions[
i]);
348 LOG_TEST(
"test_pluck_after_shutdown");
353 attr.cq_polling_type = polling_types[
i];
366 static void*
tags[128];
374 static int cb_counter;
382 bool got_shutdown =
false;
389 ~ShutdownCallback() {}
392 *
static_cast<ShutdownCallback*
>(
cb)->
done_ =
static_cast<bool>(
ok);
407 for (
size_t pidx = 0; pidx <
GPR_ARRAY_SIZE(polling_types); pidx++) {
414 attr.cq_polling_type = polling_types[pidx];
428 auto*
callback =
static_cast<TagCallback*
>(
cb);
452 nullptr, &completions[
i]);
465 while (!got_shutdown) {
476 got_shutdown =
false;
490 int main(
int argc,
char** argv) {
GPRAPI void gpr_cv_signal(gpr_cv *cv)
static void test_cq_end_op(void)
GPRAPI void gpr_mu_unlock(gpr_mu *mu)
static void do_nothing_end_completion(void *, grpc_cq_completion *)
int main(int argc, char **argv)
def completion(terminal_metadata, code, message)
GRPCAPI int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue *cq, void **tag, int *ok)
static void test_pluck_after_shutdown(void)
GPRAPI gpr_timespec gpr_inf_future(gpr_clock_type type)
void grpc_cq_end_op(grpc_completion_queue *cq, void *tag, grpc_error_handle error, void(*done)(void *done_arg, grpc_cq_completion *storage), void *done_arg, grpc_cq_completion *storage, bool internal)
static void test_callback(void)
GRPCAPI grpc_completion_queue * grpc_completion_queue_create(const grpc_completion_queue_factory *factory, const grpc_completion_queue_attributes *attributes, void *reserved)
std::atomic< bool > done_
static gpr_mu shutdown_mu
bool tags[kAvailableTags]
static gpr_cv shutdown_cv
static void test_cq_tls_cache_full(void)
GPRAPI void gpr_mu_destroy(gpr_mu *mu)
GRPCAPI void grpc_completion_queue_thread_local_cache_init(grpc_completion_queue *cq)
static void test_pollset_conversion(void)
static void test_wait_empty(void)
static void test_cq_tls_cache_empty(void)
static void shutdown_and_destroy(grpc_completion_queue *cc)
@ GRPC_CQ_DEFAULT_POLLING
GPRAPI void gpr_cv_destroy(gpr_cv *cv)
static void * tag(intptr_t t)
grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue *cq)
const GRPCAPI grpc_completion_queue_factory * grpc_completion_queue_factory_lookup(const grpc_completion_queue_attributes *attributes)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
GPRAPI void gpr_mu_init(gpr_mu *mu)
grpc_pollset * grpc_cq_pollset(grpc_completion_queue *cq)
GPRAPI int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline)
static void test_pluck(void)
GPRAPI void gpr_mu_lock(gpr_mu *mu)
static void callback(void *arg, int status, int timeouts, struct hostent *host)
static void * create_test_tag(void)
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
static void test_shutdown_then_next_with_timeout(void)
GPRAPI gpr_timespec gpr_inf_past(gpr_clock_type type)
static void shutdown_cb(uv_shutdown_t *req, int status)
GRPCAPI grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag, gpr_timespec deadline, void *reserved)
bool grpc_cq_begin_op(grpc_completion_queue *cq, void *tag)
OPENSSL_EXPORT X509_ATTRIBUTE * attr
#define GPR_ARRAY_SIZE(array)
grpc_completion_queue * cc
GRPCAPI void grpc_completion_queue_destroy(grpc_completion_queue *cq)
grpc_core::ExecCtx exec_ctx
GRPCAPI grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved)
GRPCAPI void grpc_completion_queue_shutdown(grpc_completion_queue *cq)
grpc_completion_type type
GRPCAPI void grpc_init(void)
static void test_shutdown_then_next_polling(void)
GRPCAPI void grpc_shutdown(void)
static grpc_completion_queue * cq
OPENSSL_EXPORT pem_password_cb * cb
GPRAPI void gpr_cv_init(gpr_cv *cv)
static void test_no_op(void)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:52