summaryrefslogtreecommitdiff
path: root/usrp2/host/lib/usrp2_impl.h
diff options
context:
space:
mode:
authorEric Blossom2009-09-04 03:32:32 -0700
committerEric Blossom2009-09-04 09:48:16 -0700
commit96b6c7b97e3fb9188bc6906153254dc36cedc2cb (patch)
treee3049476dabea6fd8b4383f3bcb70c74d34e81e5 /usrp2/host/lib/usrp2_impl.h
parent5d040bc94b40cab5420303f959695d89fe83e031 (diff)
downloadgnuradio-96b6c7b97e3fb9188bc6906153254dc36cedc2cb.tar.gz
gnuradio-96b6c7b97e3fb9188bc6906153254dc36cedc2cb.tar.bz2
gnuradio-96b6c7b97e3fb9188bc6906153254dc36cedc2cb.zip
Fix problem with commands timing out (specifically stop_rx_streaming)
After fixing the race, this change uses Tom's idea to stop enqueuing data when trying to stop, and adds a new flush_rx_samples method to drop any samples that may have already been accumulated. I ran Tom's test case 500 times with 0 failures ;-)
Diffstat (limited to 'usrp2/host/lib/usrp2_impl.h')
-rw-r--r--usrp2/host/lib/usrp2_impl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/usrp2/host/lib/usrp2_impl.h b/usrp2/host/lib/usrp2_impl.h
index 434e0e9b1..ed71a6ba3 100644
--- a/usrp2/host/lib/usrp2_impl.h
+++ b/usrp2/host/lib/usrp2_impl.h
@@ -87,6 +87,8 @@ namespace usrp2 {
int d_tx_interp; // shadow tx interp
int d_rx_decim; // shadow rx decim
+ bool d_dont_enqueue;
+
void inc_enqueued() {
omni_mutex_lock l(d_enqueued_mutex);
d_num_enqueued++;
@@ -142,6 +144,7 @@ namespace usrp2 {
bool read_gpio(int bank, uint16_t *value);
bool start_rx_streaming(unsigned int channel, unsigned int items_per_frame);
bool rx_samples(unsigned int channel, rx_sample_handler *handler);
+ bool flush_rx_samples(unsigned int channel);
bool stop_rx_streaming(unsigned int channel);
unsigned int rx_overruns() const { return d_num_rx_overruns; }
unsigned int rx_missing() const { return d_num_rx_missing; }