From f69010a6e60be31716702041fdbc6883abdf34aa Mon Sep 17 00:00:00 2001 From: Dominik Meyer Date: Thu, 27 Jul 2023 23:45:50 +0200 Subject: [PATCH] FIX: fixed deadlock in messagequeue --- src/WhisperCom/Service.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/WhisperCom/Service.cpp b/src/WhisperCom/Service.cpp index 8fd2b6c..a8f7c2f 100644 --- a/src/WhisperCom/Service.cpp +++ b/src/WhisperCom/Service.cpp @@ -166,9 +166,8 @@ void WhisperCom::Service::processMessage_(const zmq::message_t &msg) WhisperCom::Protobuf::Message wMsg{}; wMsg = rmsg.msg(); std::unique_lock lk(mutexMessageQueue_); - mutexMessageQueue_.lock(); messageQueue_.push(std::make_shared(wMsg)); - mutexMessageQueue_.unlock(); + lk.unlock(); condWaitMessageQueue_.notify_one(); DLOG_S(INFO) << "received data message"; }