From 0bc72d004b08b6cac005931787f43c68dace7685 Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期五, 02 四月 2021 16:25:39 +0800 Subject: [PATCH] refactor pub/sub center. --- src/socket.cpp | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/socket.cpp b/src/socket.cpp index 4c2fc6b..b9519be 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -46,7 +46,7 @@ ShmSocket::~ShmSocket() { - Stop(); + Stop(); //TODO should stop in sub class, incase thread access sub class data. } bool ShmSocket::StartRaw(const RecvRawCB &onData, int nworker) @@ -102,12 +102,7 @@ bool ShmSocket::SyncSend(const void *id, const bhome_msg::BHMsg &msg, const int timeout_ms) { - std::lock_guard<std::mutex> lock(mutex_); - if (!mq_ || RunningNoLock()) { - return false; - } else { - return mq_->Send(*static_cast<const MQId *>(id), msg, timeout_ms); - } + return mq_->Send(*static_cast<const MQId *>(id), msg, timeout_ms); } bool ShmSocket::SyncRecv(bhome_msg::BHMsg &msg, const int timeout_ms) -- Gitblit v1.8.0