lichao
2021-03-29 f51636c193d032723c47343e39ff8296db350200
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