summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2012-09-29 20:14:51 -0700
committerJohnathan Corgan2012-09-29 21:52:30 -0700
commit692890cd40aa07a8290c7fdee24c94b6a0eabb8c (patch)
tree749f19059fc6b0398941d0dfd21107c3f5376033
parenta7e260a09bdb923b77174cedd31c2d7d70f32765 (diff)
downloadgnuradio-692890cd40aa07a8290c7fdee24c94b6a0eabb8c.tar.gz
gnuradio-692890cd40aa07a8290c7fdee24c94b6a0eabb8c.tar.bz2
gnuradio-692890cd40aa07a8290c7fdee24c94b6a0eabb8c.zip
uhd: work does not block, OK to return 0 on ERROR_CODE_TIMEOUT
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_source.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc
index 139caf9dd..3813673b4 100644
--- a/gr-uhd/lib/gr_uhd_usrp_source.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_source.cc
@@ -338,8 +338,8 @@ public:
//If receive resulted in a timeout condition:
//We now receive a single packet with a large timeout.
- while (_metadata.error_code == uhd::rx_metadata_t::ERROR_CODE_TIMEOUT){
- if (boost::this_thread::interruption_requested()) return WORK_DONE;
+ if (_metadata.error_code == uhd::rx_metadata_t::ERROR_CODE_TIMEOUT)
+ {
num_samps = _rx_stream->recv(
output_items, noutput_items, _metadata, 0.1, true/*one pkt*/
);
@@ -377,9 +377,8 @@ public:
break;
case uhd::rx_metadata_t::ERROR_CODE_TIMEOUT:
- //Assume that the user called stop() on the flow graph.
- //However, a timeout can occur under error conditions.
- return WORK_DONE;
+ //its ok to timeout, perhaps the user is doing finite streaming
+ return 0;
case uhd::rx_metadata_t::ERROR_CODE_OVERFLOW:
_tag_now = true;