From 9f8a2d036970b6756de68d374f2ba203cddb0028 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 1 Jun 2011 17:46:59 -0700 Subject: usrp2: catch exceptions thrown in locker loop (like the user unplugs device) --- host/lib/usrp/usrp2/usrp2_iface.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp index bf7fe803f..85858929d 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.cpp +++ b/host/lib/usrp/usrp2/usrp2_iface.cpp @@ -19,6 +19,7 @@ #include "fw_common.h" #include "usrp2_iface.hpp" #include +#include #include #include #include @@ -143,10 +144,17 @@ public: //sleep for a bit boost::this_thread::sleep(boost::posix_time::milliseconds(1500)); } - } catch(const boost::thread_interrupted &){} - - //unlock on exit - this->get_reg(U2_FW_REG_LOCK_TIME, 0); + } + catch(const boost::thread_interrupted &){ + this->get_reg(U2_FW_REG_LOCK_TIME, 0); //unlock on exit + } + catch(const std::exception &e){ + UHD_MSG(error) + << "An unexpected exception was caught in the locker loop." << std::endl + << "The device will automatically unlock from this process." << std::endl + << e.what() << std::endl + ; + } } /*********************************************************************** -- cgit v1.2.3