From 6e740108bf2c32632d8dc107270b49b6de3ba16d Mon Sep 17 00:00:00 2001 From: michael-west Date: Tue, 15 Jul 2014 15:18:47 -0700 Subject: Fix for BUG #469 - Added mutex for write_uart() --- host/lib/usrp/x300/x300_fw_uart.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'host') diff --git a/host/lib/usrp/x300/x300_fw_uart.cpp b/host/lib/usrp/x300/x300_fw_uart.cpp index d87b9ab9f..b0fae124d 100644 --- a/host/lib/usrp/x300/x300_fw_uart.cpp +++ b/host/lib/usrp/x300/x300_fw_uart.cpp @@ -56,6 +56,7 @@ struct x300_uart_iface : uart_iface void write_uart(const std::string &buff) { + boost::mutex::scoped_lock(_write_mutex); BOOST_FOREACH(const char ch, buff) { if (ch == '\n') this->putchar('\r'); @@ -157,6 +158,7 @@ struct x300_uart_iface : uart_iface std::vector _rxcache; std::string _rxbuff; boost::mutex _read_mutex; + boost::mutex _write_mutex; }; uart_iface::sptr x300_make_uart_iface(wb_iface::sptr iface) -- cgit v1.2.3