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.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/usrp1/soft_time_ctrl.hpp') 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 -- cgit v1.2.3