From c6964d5af25d4ec7ed9dbe7674dc4e3896b36ead Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期五, 16 四月 2021 16:10:02 +0800 Subject: [PATCH] node remove mq if never registered; refactor. --- src/sendq.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sendq.h b/src/sendq.h index 7cd8b13..b4f3821 100644 --- a/src/sendq.h +++ b/src/sendq.h @@ -68,7 +68,7 @@ msg.AddRef(); TimedMsg tmp(expire, MsgInfo{msg, onExpire}); - std::unique_lock<std::mutex> lock(mutex_); + std::unique_lock<std::mutex> lock(mutex_in_); auto &al = in_[addr]; if (!al.empty()) { al.front().emplace_back(std::move(tmp)); @@ -95,7 +95,8 @@ MsgI &operator*() { return iter_->data().msg_; } }; - std::mutex mutex_; + std::mutex mutex_in_; + std::mutex mutex_out_; Store in_; Store out_; }; -- Gitblit v1.8.0