From b3b155c256bbcde92e335b3054051e198e1c0097 Mon Sep 17 00:00:00 2001 From: Guantao Liu Date: Mon, 2 Dec 2019 16:21:06 -0800 Subject: [PATCH] Fix build errors. --- src/core/lib/iomgr/poller/eventmanager_libuv.cc | 2 +- src/core/lib/iomgr/poller/eventmanager_libuv.h | 4 ++-- test/core/iomgr/poller/eventmanager_libuv_test.cc | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/lib/iomgr/poller/eventmanager_libuv.cc b/src/core/lib/iomgr/poller/eventmanager_libuv.cc index ddeebb42ff6..91fbfd7f5af 100644 --- a/src/core/lib/iomgr/poller/eventmanager_libuv.cc +++ b/src/core/lib/iomgr/poller/eventmanager_libuv.cc @@ -27,7 +27,7 @@ grpc::experimental::LibuvEventManager::Options::Options(int num_workers) : num_workers_(num_workers) {} grpc::experimental::LibuvEventManager::LibuvEventManager(const Options& options) - : options_(options) { + : options_(options), should_stop_(false), shutdown_refcount_(0) { int num_workers = options_.num_workers(); // Number of workers can't be 0 if we do not accept thread donation. // TODO(guantaol): replaces the hard-coded number with a flag. diff --git a/src/core/lib/iomgr/poller/eventmanager_libuv.h b/src/core/lib/iomgr/poller/eventmanager_libuv.h index c6f3256d62b..62cfa96a2fd 100644 --- a/src/core/lib/iomgr/poller/eventmanager_libuv.h +++ b/src/core/lib/iomgr/poller/eventmanager_libuv.h @@ -71,9 +71,9 @@ class LibuvEventManager { const Options options_; // Whether the EventManager workers should be stopped. - grpc_core::Atomic should_stop_ = false; + grpc_core::Atomic should_stop_; // A refcount preventing the EventManager from shutdown. - grpc_core::Atomic shutdown_refcount_ = 0; + grpc_core::Atomic shutdown_refcount_; // Worker threads of the EventManager. std::vector workers_; }; diff --git a/test/core/iomgr/poller/eventmanager_libuv_test.cc b/test/core/iomgr/poller/eventmanager_libuv_test.cc index deb0d010aa7..c772d5cd949 100644 --- a/test/core/iomgr/poller/eventmanager_libuv_test.cc +++ b/test/core/iomgr/poller/eventmanager_libuv_test.cc @@ -58,8 +58,7 @@ TEST(LibuvEventManager, ShutdownRefAsync) { for (int j = 0; j < i; j++) { em->ShutdownRef(); } - grpc_core::Thread deleter( - "deleter", [em](void*) { delete em; }, nullptr); + grpc_core::Thread deleter("deleter", [em](void*) { delete em; }, nullptr); deleter.Start(); gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1)); for (int j = 0; j < i; j++) {