aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-04-03 15:53:18 -0700
committerJosh Blum <josh@joshknows.com>2012-04-03 15:53:18 -0700
commita1d8b94647b6149ca38282eefac6a5f1e89fad5b (patch)
tree7d1fcc50bee55159aa0206f148ee45188da963ec /host/lib/usrp
parent40884c9411bf7d4bc91d24c939c22a3a04193d82 (diff)
parent51c81a39cc15ac221376e5acc4eceb572e0467f9 (diff)
downloaduhd-a1d8b94647b6149ca38282eefac6a5f1e89fad5b.tar.gz
uhd-a1d8b94647b6149ca38282eefac6a5f1e89fad5b.tar.bz2
uhd-a1d8b94647b6149ca38282eefac6a5f1e89fad5b.zip
Merge branch 'master' into next
Conflicts: host/examples/CMakeLists.txt
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/usrp1/soft_time_ctrl.cpp6
-rw-r--r--host/lib/usrp/usrp1/soft_time_ctrl.hpp5
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp3
3 files changed, 10 insertions, 4 deletions
diff --git a/host/lib/usrp/usrp1/soft_time_ctrl.cpp b/host/lib/usrp/usrp1/soft_time_ctrl.cpp
index 90b3a92da..65bdc36d4 100644
--- a/host/lib/usrp/usrp1/soft_time_ctrl.cpp
+++ b/host/lib/usrp/usrp1/soft_time_ctrl.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011-2012 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -207,6 +207,10 @@ public:
return _inline_msg_queue;
}
+ void stop(void){
+ _recv_cmd_task.reset();
+ }
+
private:
boost::mutex _update_mutex;
size_t _nsamps_remaining;
diff --git a/host/lib/usrp/usrp1/soft_time_ctrl.hpp b/host/lib/usrp/usrp1/soft_time_ctrl.hpp
index b92b51252..f418ec35a 100644
--- a/host/lib/usrp/usrp1/soft_time_ctrl.hpp
+++ b/host/lib/usrp/usrp1/soft_time_ctrl.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011-2012 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -67,6 +67,9 @@ public:
//! Get access to a buffer of inline metadata
virtual transport::bounded_buffer<rx_metadata_t> &get_inline_queue(void) = 0;
+
+ //! Stops threads before deconstruction to avoid race conditions
+ virtual void stop(void) = 0;
};
}} //namespace
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index 607badda9..1db2efa0d 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -413,8 +413,7 @@ usrp1_impl::~usrp1_impl(void){
this->enable_rx(false);
this->enable_tx(false);
)
- _tree.reset(); //resets counts on sptrs held in tree
- _soft_time_ctrl.reset(); //stops cmd task before proceeding
+ _soft_time_ctrl->stop(); //stops cmd task before proceeding
_io_impl.reset(); //stops vandal before other stuff gets deconstructed
}