[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/02: gr-uhd: disable boost thread interru
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/02: gr-uhd: disable boost thread interrupts during send() and recv() calls in work() |
Date: |
Wed, 14 Dec 2016 01:25:17 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 44393f4f009abf6603196f8667d9a440adcb1416
Author: Andrej Rode <address@hidden>
Date: Fri Dec 9 14:58:53 2016 -0800
gr-uhd: disable boost thread interrupts during send() and recv() calls in
work()
---
gr-uhd/lib/usrp_sink_impl.cc | 2 ++
gr-uhd/lib/usrp_source_impl.cc | 5 +++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/gr-uhd/lib/usrp_sink_impl.cc b/gr-uhd/lib/usrp_sink_impl.cc
index 8b3412b..c3ac45e 100644
--- a/gr-uhd/lib/usrp_sink_impl.cc
+++ b/gr-uhd/lib/usrp_sink_impl.cc
@@ -367,6 +367,7 @@ namespace gr {
}
}
+ boost::this_thread::disable_interruption disable_interrupt;
#ifdef GR_UHD_USE_STREAM_API
//send all ninput_items with metadata
const size_t num_sent = _tx_stream->send
@@ -376,6 +377,7 @@ namespace gr {
(input_items, ninput_items, _metadata,
*_type, ::uhd::device::SEND_MODE_FULL_BUFF, 1.0);
#endif
+ boost::this_thread::restore_interruption
restore_interrupt(disable_interrupt);
//if using length_tags, decrement items left to send by the number of
samples sent
if(not pmt::is_null(_length_tag_key) && _nitems_to_send > 0) {
diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc
index b48b151..e19367e 100644
--- a/gr-uhd/lib/usrp_source_impl.cc
+++ b/gr-uhd/lib/usrp_source_impl.cc
@@ -610,6 +610,7 @@ namespace gr {
gr_vector_void_star &output_items)
{
boost::recursive_mutex::scoped_lock lock(d_mutex);
+ boost::this_thread::disable_interruption disable_interrupt;
#ifdef GR_UHD_USE_STREAM_API
//In order to allow for low-latency:
//We receive all available packets without timeout.
@@ -632,8 +633,8 @@ namespace gr {
::uhd::device::RECV_MODE_ONE_PACKET, 1.0);
}
#endif
-
- //handle possible errors conditions
+ boost::this_thread::restore_interruption
restore_interrupt(disable_interrupt);
+ // handle possible errors conditions
switch(_metadata.error_code) {
case ::uhd::rx_metadata_t::ERROR_CODE_NONE:
if(_tag_now) {