Revert "Merge pull request #23435 from vjpai/fix_iomgr_non_polling"

This reverts commit 2d73a17587, reversing
changes made to 08d737abf8.
pull/23651/head
Vijay Pai 4 years ago
parent 1cdc78cb9e
commit afa2bd8367
  1. 12
      src/core/lib/iomgr/iomgr.cc

@ -31,7 +31,6 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/buffer_list.h"
@ -51,7 +50,7 @@ static gpr_cv g_rcv;
static int g_shutdown;
static grpc_iomgr_object g_root_object;
static bool g_grpc_abort_on_leaks;
static grpc_core::Atomic<bool> g_iomgr_non_polling{false};
static bool g_iomgr_non_polling;
void grpc_iomgr_init() {
grpc_core::ExecCtx exec_ctx;
@ -196,9 +195,14 @@ void grpc_iomgr_unregister_object(grpc_iomgr_object* obj) {
bool grpc_iomgr_abort_on_leaks(void) { return g_grpc_abort_on_leaks; }
bool grpc_iomgr_non_polling() {
return g_iomgr_non_polling.Load(grpc_core::MemoryOrder::SEQ_CST);
gpr_mu_lock(&g_mu);
bool ret = g_iomgr_non_polling;
gpr_mu_unlock(&g_mu);
return ret;
}
void grpc_iomgr_mark_non_polling_internal() {
g_iomgr_non_polling.Store(true, grpc_core::MemoryOrder::SEQ_CST);
gpr_mu_lock(&g_mu);
g_iomgr_non_polling = true;
gpr_mu_unlock(&g_mu);
}

Loading…
Cancel
Save