aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-07-20 20:42:10 -0700
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-07-23 13:47:43 -0700
commitb4151156f9e4f8316eb68a2826f9c366b830cbf3 (patch)
tree6b55a29ef158f8012896528981e45d89b977e5f4 /host/lib
parent5b18614d39f5cebdd8bf3bf6e5acf3a34f204191 (diff)
downloaduhd-b4151156f9e4f8316eb68a2826f9c366b830cbf3.tar.gz
uhd-b4151156f9e4f8316eb68a2826f9c366b830cbf3.tar.bz2
uhd-b4151156f9e4f8316eb68a2826f9c366b830cbf3.zip
x300: Fix incorrectly declared locks
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/x300/x300_fw_uart.cpp4
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/host/lib/usrp/x300/x300_fw_uart.cpp b/host/lib/usrp/x300/x300_fw_uart.cpp
index b6c2081ad..912d977ed 100644
--- a/host/lib/usrp/x300/x300_fw_uart.cpp
+++ b/host/lib/usrp/x300/x300_fw_uart.cpp
@@ -53,7 +53,7 @@ struct x300_uart_iface : uart_iface
void write_uart(const std::string &buff)
{
- boost::mutex::scoped_lock(_write_mutex);
+ boost::mutex::scoped_lock lock(_write_mutex);
for(const char ch: buff)
{
this->putchar(ch);
@@ -125,7 +125,7 @@ struct x300_uart_iface : uart_iface
std::string read_uart(double timeout)
{
- boost::mutex::scoped_lock(_read_mutex);
+ boost::mutex::scoped_lock lock(_read_mutex);
const auto exit_time =
std::chrono::steady_clock::now()
+ std::chrono::microseconds(int64_t(timeout*1e6));
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index 051242e0a..0c8d78834 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -211,7 +211,7 @@ static device_addrs_t x300_find_pcie(const device_addr_t &hint, bool explicit_qu
//Hold on to the registry mutex as long as zpu_ctrl is alive
//to prevent any use by different threads while enumerating
- boost::mutex::scoped_lock(pcie_zpu_iface_registry_mutex);
+ boost::mutex::scoped_lock lock(pcie_zpu_iface_registry_mutex);
if (get_pcie_zpu_iface_registry().has_key(resource_d)) {
zpu_ctrl = get_pcie_zpu_iface_registry()[resource_d].lock();
@@ -712,7 +712,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
//create basic communication
UHD_LOGGER_DEBUG("X300") << "Setting up basic communication...";
if (mb.xport_path == "nirio") {
- boost::mutex::scoped_lock(pcie_zpu_iface_registry_mutex);
+ boost::mutex::scoped_lock lock(pcie_zpu_iface_registry_mutex);
if (get_pcie_zpu_iface_registry().has_key(mb.get_pri_eth().addr)) {
throw uhd::assertion_error("Someone else has a ZPU transport to the device open. Internal error!");
} else {
@@ -1112,7 +1112,7 @@ x300_impl::~x300_impl(void)
//kill the claimer task and unclaim the device
mb.claimer_task.reset();
{ //Critical section
- boost::mutex::scoped_lock(pcie_zpu_iface_registry_mutex);
+ boost::mutex::scoped_lock lock(pcie_zpu_iface_registry_mutex);
release(mb.zpu_ctrl);
//If the process is killed, the entire registry will disappear so we
//don't need to worry about unclean shutdowns here.