Fixup layering (#27482)

* fixup layering

* Automated change: Fix sanity tests

* fix test

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
pull/27483/head
Craig Tiller 4 years ago committed by GitHub
parent 57982f0ec6
commit e977ef0351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/core/lib/iomgr/iomgr.cc
  2. 10
      src/core/lib/iomgr/iomgr_internal.cc
  3. 2
      src/core/lib/iomgr/iomgr_internal.h
  4. 4
      test/core/iomgr/timer_list_test.cc
  5. 3
      test/core/promise/exec_ctx_wakeup_scheduler_test.cc

@ -53,7 +53,9 @@ static bool g_grpc_abort_on_leaks;
void grpc_iomgr_init() {
grpc_core::ExecCtx exec_ctx;
grpc_determine_iomgr_platform();
if (!grpc_have_determined_iomgr_platform()) {
grpc_set_default_iomgr_platform();
}
g_shutdown = 0;
gpr_mu_init(&g_mu);
gpr_cv_init(&g_rcv);

@ -24,14 +24,12 @@
static grpc_iomgr_platform_vtable* iomgr_platform_vtable = nullptr;
void grpc_set_iomgr_platform_vtable(grpc_iomgr_platform_vtable* vtable) {
iomgr_platform_vtable = vtable;
bool grpc_have_determined_iomgr_platform() {
return iomgr_platform_vtable != nullptr;
}
void grpc_determine_iomgr_platform() {
if (iomgr_platform_vtable == nullptr) {
grpc_set_default_iomgr_platform();
}
void grpc_set_iomgr_platform_vtable(grpc_iomgr_platform_vtable* vtable) {
iomgr_platform_vtable = vtable;
}
void grpc_iomgr_platform_init() { iomgr_platform_vtable->init(); }

@ -45,7 +45,7 @@ typedef struct grpc_iomgr_platform_vtable {
void grpc_iomgr_register_object(grpc_iomgr_object* obj, const char* name);
void grpc_iomgr_unregister_object(grpc_iomgr_object* obj);
void grpc_determine_iomgr_platform();
bool grpc_have_determined_iomgr_platform();
void grpc_set_iomgr_platform_vtable(grpc_iomgr_platform_vtable* vtable);

@ -224,7 +224,7 @@ int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
grpc_core::ExecCtx::GlobalInit();
grpc_core::ExecCtx exec_ctx;
grpc_determine_iomgr_platform();
grpc_set_default_iomgr_platform();
grpc_iomgr_platform_init();
gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
add_test();
@ -245,7 +245,7 @@ int main(int argc, char** argv) {
gpr_clock_type::GPR_CLOCK_MONOTONIC));
grpc_core::ExecCtx::TestOnlyGlobalInit(new_start);
grpc_core::ExecCtx exec_ctx;
grpc_determine_iomgr_platform();
grpc_set_default_iomgr_platform();
grpc_iomgr_platform_init();
gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
long_running_service_cleanup_test();

@ -57,9 +57,6 @@ TEST(ExecCtxWakeupSchedulerTest, Works) {
} // namespace grpc_core
// Hook needed to run ExecCtx outside of iomgr.
void grpc_set_default_iomgr_platform() {}
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
grpc_core::ExecCtx::GlobalInit();

Loading…
Cancel
Save