From f51636c193d032723c47343e39ff8296db350200 Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期一, 29 三月 2021 18:04:00 +0800 Subject: [PATCH] change msg to use protobuf, add more msg type. --- src/pubsub.cpp | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pubsub.cpp b/src/pubsub.cpp index e38c445..ee2614a 100644 --- a/src/pubsub.cpp +++ b/src/pubsub.cpp @@ -44,7 +44,7 @@ while (this->run_) { std::this_thread::sleep_for(100ms); BusManager &self = *this; - Msg msg; + BHMsg msg; const int timeout_ms = 100; if (!self.busq_.Recv(msg, timeout_ms)) { continue; @@ -59,12 +59,13 @@ for (int i = 0; i < n; ++i) { workers_.emplace_back(Worker); } + return true; } bool BusManager::Stop() { std::lock_guard<std::mutex> guard(mutex_); - StopNoLock(); + return StopNoLock(); } bool BusManager::StopNoLock() @@ -75,7 +76,9 @@ w.join(); } } + return true; } + return false; } } // namespace bhome_shm -- Gitblit v1.8.0