From c762e0ad84dcdb5f6582c2a0361f6265cb005e0b Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sun, 19 Jan 2014 20:12:03 +0100 Subject: serial: unify unblocking readBlocking() --- src/SerialTty.cpp | 5 ++++- src/SerialUsb.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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 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 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(); -- cgit v1.2.3