From 3e8e9dad3c2bdd5e7151956ba9b87142d2cb1435 Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Thu, 29 Mar 2012 10:05:00 -0700 Subject: cmake: Binaries give notification before installing or uninstalling UHD. Better to give an output than just an empty pause. --- host/cmake/debian/preinst.in | 2 +- host/cmake/debian/prerm.in | 1 + host/cmake/redhat/pre_install.in | 2 ++ host/cmake/redhat/pre_uninstall.in | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/host/cmake/debian/preinst.in b/host/cmake/debian/preinst.in index 9e8e50b90..71246b7e7 100755 --- a/host/cmake/debian/preinst.in +++ b/host/cmake/debian/preinst.in @@ -17,5 +17,5 @@ # if [ "$1" = "install" ]; then - echo + echo 'Installing UHD.' fi diff --git a/host/cmake/debian/prerm.in b/host/cmake/debian/prerm.in index 30ce41963..dfe491767 100755 --- a/host/cmake/debian/prerm.in +++ b/host/cmake/debian/prerm.in @@ -17,6 +17,7 @@ # if [ "$1" = "remove" ]; then + echo 'Uninstalling UHD.' rm /etc/udev/rules.d/uhd-usrp.rules udevadm control --reload-rules fi diff --git a/host/cmake/redhat/pre_install.in b/host/cmake/redhat/pre_install.in index b611fb381..e62d603ab 100755 --- a/host/cmake/redhat/pre_install.in +++ b/host/cmake/redhat/pre_install.in @@ -15,3 +15,5 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # + +echo 'Installing UHD.' diff --git a/host/cmake/redhat/pre_uninstall.in b/host/cmake/redhat/pre_uninstall.in index f1faa36ce..806da7f7c 100755 --- a/host/cmake/redhat/pre_uninstall.in +++ b/host/cmake/redhat/pre_uninstall.in @@ -16,5 +16,6 @@ # along with this program. If not, see . # +echo 'Uninstalling UHD.' rm /etc/udev/rules.d/uhd-usrp.rules udevadm control --reload-rules -- cgit v1.2.3 From 7ac203b39c126c4bdb9b2f5494052fd9eea8f21b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 29 Mar 2012 11:59:27 -0700 Subject: usrp1: stop threads in deconstructor Its important to stop the threads before we let the other smart point objects naturally deconstruct to avoid thread-based race conditions. The attempt to deconstruct the tree and soft time ctrl had a bug because the tree had references in subtrees within the dboard manager class. Rather than continue to fix this method and deconstruct the tree to free up soft time ctrl, it seems simpler to just stop the thread in soft time ctrl, and then let it naturally deconstruct later by ref count. --- host/lib/usrp/usrp1/soft_time_ctrl.cpp | 6 +++++- host/lib/usrp/usrp1/soft_time_ctrl.hpp | 5 ++++- host/lib/usrp/usrp1/usrp1_impl.cpp | 3 +-- 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 &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 } -- cgit v1.2.3