From b5ad1dc8b193719e5b2c4396760980ba9dbbbfd6 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 7 Apr 2014 16:01:27 +0200 Subject: [PATCH] streamts.cpp StreamInstance::Send: do not block neutrino by faulty stream Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c170b03b9ae564b222edc9aaa00dace0e3ffbd94 Author: Jacek Jendrzej Date: 2014-04-07 (Mon, 07 Apr 2014) --- src/driver/streamts.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 5ceb7983f..aaf9574fb 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -113,11 +113,15 @@ bool CStreamInstance::Stop() bool CStreamInstance::Send(ssize_t r) { - OpenThreads::ScopedLock m_lock(mutex); + //OpenThreads::ScopedLock m_lock(mutex); + stream_fds_t cfds; + mutex.lock(); + cfds = fds; + mutex.unlock(); int flags = 0; - if (fds.size() > 1) + if (cfds.size() > 1) flags = MSG_DONTWAIT; - for (stream_fds_t::iterator it = fds.begin(); it != fds.end(); ++it) { + for (stream_fds_t::iterator it = cfds.begin(); it != cfds.end(); ++it) { int i = 10; unsigned char *b = buf; ssize_t count = r;