summaryrefslogtreecommitdiff
path: root/gr-uhd
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-04 18:38:47 -0800
committerJosh Blum <josh@joshknows.com>2010-03-04 18:38:47 -0800
commit6c79d5158ace300038937688bb11309736926214 (patch)
treec9946df3fed82f34135aeff0f168ce906b175f28 /gr-uhd
parent23f6fc0f5f484380fe5f934ec97c4397d3675cb6 (diff)
removed timeout from here
Diffstat (limited to 'gr-uhd')
-rw-r--r--gr-uhd/lib/uhd_simple_source.cc19
1 files changed, 3 insertions, 16 deletions
diff --git a/gr-uhd/lib/uhd_simple_source.cc b/gr-uhd/lib/uhd_simple_source.cc
index 17691c7aec..a8977abc32 100644
--- a/gr-uhd/lib/uhd_simple_source.cc
+++ b/gr-uhd/lib/uhd_simple_source.cc
@@ -22,7 +22,6 @@
#include <uhd_simple_source.h>
#include <gr_io_signature.h>
-#include <boost/thread.hpp>
#include <stdexcept>
#include "utils.h"
@@ -84,7 +83,6 @@ int uhd_simple_source::work(
if (not _is_streaming) set_streaming(true);
size_t total_items_read = 0;
- size_t timeout_count = 50;
uhd::rx_metadata_t metadata;
//call until the output items are all filled
@@ -96,21 +94,10 @@ int uhd_simple_source::work(
(noutput_items-total_items_read)*_sizeof_samp
), metadata, _type
);
+ total_items_read += items_read;
- //record items read and recv again
- if (items_read > 0){
- total_items_read += items_read;
- continue;
- }
-
- //if we have read at least once, but not this time, get out
- // commented out behaviour: I believe that it would be better to
- // fill the buffer entirely to mimimize scheduler context switching
- //if (total_items_read > 0) break;
-
- //the timeout part
- boost::this_thread::sleep(boost::posix_time::milliseconds(1));
- if (--timeout_count == 0) break;
+ //we timed out, get out of here
+ if (items_read == 0) break;
}
return total_items_read;