diff options
-rw-r--r-- | src/SerialTty.cpp | 5 | ||||
-rw-r--r-- | src/SerialUsb.cpp | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/SerialTty.cpp b/src/SerialTty.cpp index f796866..5fe98b9 100644 --- a/src/SerialTty.cpp +++ b/src/SerialTty.cpp @@ -318,7 +318,10 @@ SerialTty::close() { m_p->m_recvThKill = 1; - m_p->m_condQueue.notify_all(); + { + boost::unique_lock<boost::mutex> lock(m_p->m_queueMtx); + m_p->m_condQueue.notify_all(); + } m_p->m_recvTh.join(); diff --git a/src/SerialUsb.cpp b/src/SerialUsb.cpp index eedb4ad..7a64d2e 100644 --- a/src/SerialUsb.cpp +++ b/src/SerialUsb.cpp @@ -506,7 +506,7 @@ SerialUsb::close() m_p->m_recvThKill = 1; { boost::unique_lock<boost::mutex> lock(m_p->m_queueMtx); - m_p->m_condQueue.notify_one(); // make sure an other thread calling readBlocking() moves on too + m_p->m_condQueue.notify_all(); // make sure an other thread calling readBlocking() moves on too } m_p->m_recvTh.join(); |