test changes

reviewable/pr20892/r1
Yash Tibrewal 5 years ago
parent 5d18d4450a
commit 3a189d7e08
  1. 4
      test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
  2. 17
      test/core/end2end/fuzzers/api_fuzzer.cc
  3. 4
      test/core/end2end/goaway_server_test.cc
  4. 2
      test/core/iomgr/udp_server_test.cc
  5. 14
      test/core/security/credentials_test.cc
  6. 10
      test/core/security/jwt_verifier_test.cc
  7. 12
      test/core/util/mock_endpoint.cc
  8. 19
      test/core/util/passthru_endpoint.cc
  9. 3
      test/core/util/trickle_endpoint.cc
  10. 6
      test/cpp/microbenchmarks/bm_call_create.cc
  11. 15
      test/cpp/microbenchmarks/bm_chttp2_transport.cc
  12. 23
      test/cpp/microbenchmarks/bm_closure.cc
  13. 2
      test/cpp/microbenchmarks/bm_cq_multiple_threads.cc

@ -54,7 +54,7 @@ static void my_resolve_address(const char* addr, const char* /*default_port*/,
gpr_malloc(sizeof(*(*addrs)->addrs)));
(*addrs)->addrs[0].len = 123;
}
GRPC_CLOSURE_SCHED(on_done, error);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, error);
}
static grpc_address_resolver_vtable test_resolver = {my_resolve_address,
@ -81,7 +81,7 @@ static grpc_ares_request* my_dns_lookup_ares_locked(
dummy_resolved_address.len = 123;
(*addresses)->emplace_back(dummy_resolved_address, nullptr);
}
GRPC_CLOSURE_SCHED(on_done, error);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, error);
return nullptr;
}

@ -347,11 +347,11 @@ static void finish_resolve(void* arg, grpc_error* error) {
dummy_resolved_address.len = 0;
(*r->addresses)->emplace_back(dummy_resolved_address, nullptr);
}
GRPC_CLOSURE_SCHED(r->on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, GRPC_ERROR_NONE);
} else {
GRPC_CLOSURE_SCHED(r->on_done,
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Resolution failed", &error, 1));
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done,
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Resolution failed", &error, 1));
}
gpr_free(r->addr);
@ -412,7 +412,7 @@ static void do_connect(void* arg, grpc_error* error) {
future_connect* fc = static_cast<future_connect*>(arg);
if (error != GRPC_ERROR_NONE) {
*fc->ep = nullptr;
GRPC_CLOSURE_SCHED(fc->closure, GRPC_ERROR_REF(error));
grpc_core::ExecCtx::Run(DEBUG_LOCATION, fc->closure, GRPC_ERROR_REF(error));
} else if (g_server != nullptr) {
grpc_endpoint* client;
grpc_endpoint* server;
@ -424,7 +424,7 @@ static void do_connect(void* arg, grpc_error* error) {
grpc_server_setup_transport(g_server, transport, nullptr, nullptr, nullptr);
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr);
GRPC_CLOSURE_SCHED(fc->closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, fc->closure, GRPC_ERROR_NONE);
} else {
sched_connect(fc->closure, fc->ep, fc->deadline);
}
@ -435,8 +435,9 @@ static void sched_connect(grpc_closure* closure, grpc_endpoint** ep,
gpr_timespec deadline) {
if (gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) < 0) {
*ep = nullptr;
GRPC_CLOSURE_SCHED(closure, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Connect deadline exceeded"));
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, closure,
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connect deadline exceeded"));
return;
}

@ -88,7 +88,7 @@ static void my_resolve_address(const char* addr, const char* default_port,
(*addrs)->addrs[0].len = static_cast<socklen_t>(sizeof(*sa));
gpr_mu_unlock(&g_mu);
}
GRPC_CLOSURE_SCHED(on_done, error);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, error);
}
static grpc_error* my_blocking_resolve_address(
@ -127,7 +127,7 @@ static grpc_ares_request* my_dns_lookup_ares_locked(
(*addresses)->emplace_back(&sa, sizeof(sa), nullptr);
gpr_mu_unlock(&g_mu);
}
GRPC_CLOSURE_SCHED(on_done, error);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, error);
return nullptr;
}

@ -99,7 +99,7 @@ class TestGrpcUdpHandler : public GrpcUdpHandler {
void* /*user_data*/) override {
gpr_log(GPR_INFO, "gRPC FD about to be orphaned: %d",
grpc_fd_wrapped_fd(emfd()));
GRPC_CLOSURE_SCHED(orphan_fd_closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, orphan_fd_closure, GRPC_ERROR_NONE);
g_number_of_orphan_calls++;
}

@ -564,7 +564,7 @@ static int compute_engine_httpcli_get_success_override(
grpc_closure* on_done, grpc_httpcli_response* response) {
validate_compute_engine_http_request(request);
*response = http_response(200, valid_oauth2_json_response);
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@ -573,7 +573,7 @@ static int compute_engine_httpcli_get_failure_override(
grpc_closure* on_done, grpc_httpcli_response* response) {
validate_compute_engine_http_request(request);
*response = http_response(403, "Not Authorized.");
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@ -667,7 +667,7 @@ static int refresh_token_httpcli_post_success(
grpc_httpcli_response* response) {
validate_refresh_token_http_request(request, body, body_size);
*response = http_response(200, valid_oauth2_json_response);
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@ -678,7 +678,7 @@ static int token_httpcli_post_failure(const grpc_httpcli_request* /*request*/,
grpc_closure* on_done,
grpc_httpcli_response* response) {
*response = http_response(403, "Not Authorized.");
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@ -881,7 +881,7 @@ static int sts_token_httpcli_post_success(const grpc_httpcli_request* request,
grpc_httpcli_response* response) {
validate_sts_token_http_request(request, body, body_size);
*response = http_response(200, valid_sts_json_response);
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@ -1215,7 +1215,7 @@ static int default_creds_metadata_server_detection_httpcli_get_success_override(
response->hdrs = headers;
GPR_ASSERT(strcmp(request->http.path, "/") == 0);
GPR_ASSERT(strcmp(request->host, "metadata.google.internal.") == 0);
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@ -1306,7 +1306,7 @@ static int default_creds_gce_detection_httpcli_get_failure_override(
GPR_ASSERT(strcmp(request->http.path, "/") == 0);
GPR_ASSERT(strcmp(request->host, "metadata.google.internal.") == 0);
*response = http_response(200, "");
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}

@ -335,7 +335,7 @@ static int httpcli_get_google_keys_for_email(
"/robot/v1/metadata/x509/"
"777-abaslkan11hlb6nmim3bpspl31ud@developer."
"gserviceaccount.com") == 0);
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@ -378,7 +378,7 @@ static int httpcli_get_custom_keys_for_email(
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "keys.bar.com") == 0);
GPR_ASSERT(strcmp(request->http.path, "/jwk/foo@bar.com") == 0);
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@ -411,7 +411,7 @@ static int httpcli_get_jwk_set(const grpc_httpcli_request* request,
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
GPR_ASSERT(strcmp(request->http.path, "/oauth2/v3/certs") == 0);
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@ -425,7 +425,7 @@ static int httpcli_get_openid_config(const grpc_httpcli_request* request,
GPR_ASSERT(strcmp(request->http.path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0);
grpc_httpcli_set_override(httpcli_get_jwk_set,
httpcli_post_should_not_be_called);
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@ -464,7 +464,7 @@ static int httpcli_get_bad_json(const grpc_httpcli_request* request,
grpc_httpcli_response* response) {
*response = http_response(200, gpr_strdup("{\"bad\": \"stuff\"}"));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GRPC_CLOSURE_SCHED(on_done, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}

@ -46,7 +46,7 @@ static void me_read(grpc_endpoint* ep, grpc_slice_buffer* slices,
gpr_mu_lock(&m->mu);
if (m->read_buffer.count > 0) {
grpc_slice_buffer_swap(&m->read_buffer, slices);
GRPC_CLOSURE_SCHED(cb, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
} else {
m->on_read = cb;
m->on_read_out = slices;
@ -60,7 +60,7 @@ static void me_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
for (size_t i = 0; i < slices->count; i++) {
m->on_write(slices->slices[i]);
}
GRPC_CLOSURE_SCHED(cb, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
}
static void me_add_to_pollset(grpc_endpoint* /*ep*/,
@ -76,9 +76,9 @@ static void me_shutdown(grpc_endpoint* ep, grpc_error* why) {
mock_endpoint* m = reinterpret_cast<mock_endpoint*>(ep);
gpr_mu_lock(&m->mu);
if (m->on_read) {
GRPC_CLOSURE_SCHED(m->on_read,
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Endpoint Shutdown", &why, 1));
grpc_core::ExecCtx::Run(DEBUG_LOCATION, m->on_read,
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Endpoint Shutdown", &why, 1));
m->on_read = nullptr;
}
gpr_mu_unlock(&m->mu);
@ -139,7 +139,7 @@ void grpc_mock_endpoint_put_read(grpc_endpoint* ep, grpc_slice slice) {
gpr_mu_lock(&m->mu);
if (m->on_read != nullptr) {
grpc_slice_buffer_add(m->on_read_out, slice);
GRPC_CLOSURE_SCHED(m->on_read, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, m->on_read, GRPC_ERROR_NONE);
m->on_read = nullptr;
} else {
grpc_slice_buffer_add(&m->read_buffer, slice);

@ -58,11 +58,12 @@ static void me_read(grpc_endpoint* ep, grpc_slice_buffer* slices,
half* m = reinterpret_cast<half*>(ep);
gpr_mu_lock(&m->parent->mu);
if (m->parent->shutdown) {
GRPC_CLOSURE_SCHED(
cb, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already shutdown"));
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, cb,
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already shutdown"));
} else if (m->read_buffer.count > 0) {
grpc_slice_buffer_swap(&m->read_buffer, slices);
GRPC_CLOSURE_SCHED(cb, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
} else {
m->on_read = cb;
m->on_read_out = slices;
@ -87,7 +88,7 @@ static void me_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
for (size_t i = 0; i < slices->count; i++) {
grpc_slice_buffer_add(m->on_read_out, grpc_slice_copy(slices->slices[i]));
}
GRPC_CLOSURE_SCHED(m->on_read, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, m->on_read, GRPC_ERROR_NONE);
m->on_read = nullptr;
} else {
for (size_t i = 0; i < slices->count; i++) {
@ -96,7 +97,7 @@ static void me_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
}
}
gpr_mu_unlock(&m->parent->mu);
GRPC_CLOSURE_SCHED(cb, error);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
}
static void me_add_to_pollset(grpc_endpoint* /*ep*/,
@ -113,15 +114,15 @@ static void me_shutdown(grpc_endpoint* ep, grpc_error* why) {
gpr_mu_lock(&m->parent->mu);
m->parent->shutdown = true;
if (m->on_read) {
GRPC_CLOSURE_SCHED(
m->on_read,
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, m->on_read,
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING("Shutdown", &why, 1));
m->on_read = nullptr;
}
m = other_half(m);
if (m->on_read) {
GRPC_CLOSURE_SCHED(
m->on_read,
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, m->on_read,
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING("Shutdown", &why, 1));
m->on_read = nullptr;
}

@ -56,7 +56,8 @@ static void maybe_call_write_cb_locked(trickle_endpoint* te) {
if (te->write_cb != nullptr &&
(te->error != GRPC_ERROR_NONE ||
te->write_buffer.length <= WRITE_BUFFER_SIZE)) {
GRPC_CLOSURE_SCHED(te->write_cb, GRPC_ERROR_REF(te->error));
grpc_core::ExecCtx::Run(DEBUG_LOCATION, te->write_cb,
GRPC_ERROR_REF(te->error));
te->write_cb = nullptr;
}
}

@ -414,7 +414,7 @@ void SetPollsetSet(grpc_transport* /*self*/, grpc_stream* /*stream*/,
/* implementation of grpc_transport_perform_stream_op */
void PerformStreamOp(grpc_transport* /*self*/, grpc_stream* /*stream*/,
grpc_transport_stream_op_batch* op) {
GRPC_CLOSURE_SCHED(op->on_complete, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete, GRPC_ERROR_NONE);
}
/* implementation of grpc_transport_perform_op */
@ -636,7 +636,7 @@ static void StartTransportOp(grpc_channel_element* /*elem*/,
if (op->disconnect_with_error != GRPC_ERROR_NONE) {
GRPC_ERROR_UNREF(op->disconnect_with_error);
}
GRPC_CLOSURE_SCHED(op->on_consumed, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, GRPC_ERROR_NONE);
}
static grpc_error* InitCallElem(grpc_call_element* elem,
@ -652,7 +652,7 @@ static void SetPollsetOrPollsetSet(grpc_call_element* /*elem*/,
static void DestroyCallElem(grpc_call_element* /*elem*/,
const grpc_call_final_info* /*final_info*/,
grpc_closure* then_sched_closure) {
GRPC_CLOSURE_SCHED(then_sched_closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, then_sched_closure, GRPC_ERROR_NONE);
}
grpc_error* InitChannelElem(grpc_channel_element* /*elem*/,

@ -67,7 +67,7 @@ class DummyEndpoint : public grpc_endpoint {
return;
}
grpc_slice_buffer_add(slices_, slice);
GRPC_CLOSURE_SCHED(read_cb_, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, read_cb_, GRPC_ERROR_NONE);
read_cb_ = nullptr;
}
@ -83,7 +83,7 @@ class DummyEndpoint : public grpc_endpoint {
if (have_slice_) {
have_slice_ = false;
grpc_slice_buffer_add(slices, buffered_slice_);
GRPC_CLOSURE_SCHED(cb, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
return;
}
read_cb_ = cb;
@ -97,7 +97,7 @@ class DummyEndpoint : public grpc_endpoint {
static void write(grpc_endpoint* /*ep*/, grpc_slice_buffer* /*slices*/,
grpc_closure* cb, void* /*arg*/) {
GRPC_CLOSURE_SCHED(cb, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
}
static void add_to_pollset(grpc_endpoint* /*ep*/, grpc_pollset* /*pollset*/) {
@ -111,7 +111,8 @@ class DummyEndpoint : public grpc_endpoint {
static void shutdown(grpc_endpoint* ep, grpc_error* why) {
grpc_resource_user_shutdown(static_cast<DummyEndpoint*>(ep)->ru_);
GRPC_CLOSURE_SCHED(static_cast<DummyEndpoint*>(ep)->read_cb_, why);
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
static_cast<DummyEndpoint*>(ep)->read_cb_, why);
}
static void destroy(grpc_endpoint* ep) {
@ -354,7 +355,7 @@ static void BM_StreamCreateSendInitialMetadataDestroy(benchmark::State& state) {
s->Op(&op);
s->DestroyThen(start.get());
});
GRPC_CLOSURE_SCHED(start.get(), GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, start.get(), GRPC_ERROR_NONE);
f.FlushExecCtx();
gpr_event_wait(&bm_done, gpr_inf_future(GPR_CLOCK_REALTIME));
grpc_metadata_batch_destroy(&b);
@ -381,7 +382,7 @@ static void BM_TransportEmptyOp(benchmark::State& state) {
op.on_complete = c.get();
s->Op(&op);
});
GRPC_CLOSURE_SCHED(c.get(), GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, c.get(), GRPC_ERROR_NONE);
f.FlushExecCtx();
reset_op();
op.cancel_stream = true;
@ -613,7 +614,7 @@ static void BM_TransportStreamRecv(benchmark::State& state) {
do {
if (received == recv_stream->length()) {
recv_stream.reset();
GRPC_CLOSURE_SCHED(c.get(), GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, c.get(), GRPC_ERROR_NONE);
return;
}
} while (recv_stream->Next(recv_stream->length() - received,

@ -125,7 +125,7 @@ static void BM_ClosureSchedOnExecCtx(benchmark::State& state) {
GRPC_CLOSURE_INIT(&c, DoNothing, nullptr, grpc_schedule_on_exec_ctx);
grpc_core::ExecCtx exec_ctx;
for (auto _ : state) {
GRPC_CLOSURE_SCHED(&c, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &c, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Get()->Flush();
}
@ -141,8 +141,8 @@ static void BM_ClosureSched2OnExecCtx(benchmark::State& state) {
GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, grpc_schedule_on_exec_ctx);
grpc_core::ExecCtx exec_ctx;
for (auto _ : state) {
GRPC_CLOSURE_SCHED(&c1, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c2, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &c1, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &c2, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Get()->Flush();
}
@ -160,9 +160,9 @@ static void BM_ClosureSched3OnExecCtx(benchmark::State& state) {
GRPC_CLOSURE_INIT(&c3, DoNothing, nullptr, grpc_schedule_on_exec_ctx);
grpc_core::ExecCtx exec_ctx;
for (auto _ : state) {
GRPC_CLOSURE_SCHED(&c1, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c2, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c3, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &c1, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &c2, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &c3, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Get()->Flush();
}
@ -354,12 +354,15 @@ class Rescheduler {
GRPC_CLOSURE_INIT(&closure_, Step, this, scheduler);
}
void ScheduleFirst() { GRPC_CLOSURE_SCHED(&closure_, GRPC_ERROR_NONE); }
void ScheduleFirst() {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
}
void ScheduleFirstAgainstDifferentScheduler(
grpc_closure_scheduler* scheduler) {
GRPC_CLOSURE_SCHED(GRPC_CLOSURE_CREATE(Step, this, scheduler),
GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
GRPC_CLOSURE_CREATE(Step, this, scheduler),
GRPC_ERROR_NONE);
}
private:
@ -369,7 +372,7 @@ class Rescheduler {
static void Step(void* arg, grpc_error* /*error*/) {
Rescheduler* self = static_cast<Rescheduler*>(arg);
if (self->state_.KeepRunning()) {
GRPC_CLOSURE_SCHED(&self->closure_, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &self->closure_, GRPC_ERROR_NONE);
}
}
};

@ -45,7 +45,7 @@ static grpc_completion_queue* g_cq;
static grpc_event_engine_vtable g_vtable;
static void pollset_shutdown(grpc_pollset* /*ps*/, grpc_closure* closure) {
GRPC_CLOSURE_SCHED(closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
}
static void pollset_init(grpc_pollset* ps, gpr_mu** mu) {

Loading…
Cancel
Save