diff options
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/device.cpp | 7 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_xcvr2450.cpp | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/host/lib/device.cpp b/host/lib/device.cpp index 1b3daa103..b2b0238d2 100644 --- a/host/lib/device.cpp +++ b/host/lib/device.cpp @@ -25,10 +25,13 @@ #include <boost/weak_ptr.hpp> #include <boost/functional/hash.hpp> #include <boost/tuple/tuple.hpp> +#include <boost/thread/mutex.hpp> #include <iostream> using namespace uhd; +static boost::mutex _device_mutex; + /*********************************************************************** * Helper Functions **********************************************************************/ @@ -70,6 +73,8 @@ void device::register_device( * Discover **********************************************************************/ device_addrs_t device::find(const device_addr_t &hint){ + boost::mutex::scoped_lock lock(_device_mutex); + device_addrs_t device_addrs; BOOST_FOREACH(const dev_fcn_reg_t &fcn, get_dev_fcn_regs()){ @@ -93,6 +98,8 @@ device_addrs_t device::find(const device_addr_t &hint){ * Make **********************************************************************/ device::sptr device::make(const device_addr_t &hint, size_t which){ + boost::mutex::scoped_lock lock(_device_mutex); + typedef boost::tuple<device_addr_t, make_t> dev_addr_make_t; std::vector<dev_addr_make_t> dev_addr_makers; diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 70b0bbabd..45f600569 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -153,7 +153,7 @@ private: */ double get_rssi(void){ //*FIXME* RSSI depends on LNA Gain Setting (datasheet pg 16 top middle chart) - double max_power; + double max_power = 0.0; switch(_max2829_regs.rx_lna_gain){ case 0: case 1: max_power = 0; break; |