FIX: fixed deadlock in messagequeue

This commit is contained in:
Dominik Meyer 2023-07-27 23:45:50 +02:00
parent df04dcee00
commit f69010a6e6
No known key found for this signature in database
GPG Key ID: B4C312B600606B64

View File

@ -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<WhisperCom::Protobuf::Message>(wMsg));
mutexMessageQueue_.unlock();
lk.unlock();
condWaitMessageQueue_.notify_one();
DLOG_S(INFO) << "received data message";
}