diff options
author | RALOVICH, Kristof <tade60@freemail.hu> | 2014-01-19 20:12:03 +0100 |
---|---|---|
committer | RALOVICH, Kristof <tade60@freemail.hu> | 2014-01-19 20:12:03 +0100 |
commit | c762e0ad84dcdb5f6582c2a0361f6265cb005e0b (patch) | |
tree | 4fe4cbb330883439f5e566943666faef7d47ab24 /src | |
parent | a22ee1ffec5486059c41929a20c2da3424fcafc6 (diff) |
serial: unify unblocking readBlocking()
Diffstat (limited to 'src')
-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(); |