aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/libusb1_control.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-07-02 19:35:33 -0700
committerJosh Blum <josh@joshknows.com>2011-07-02 19:35:33 -0700
commit1ef40895952f94ccd21fca48033b5a14d7e4ff30 (patch)
tree9fc59f12a745cb6a0852c3645a8544100b0fabad /host/lib/transport/libusb1_control.cpp
parent4bcab9c56aad7e08bd392b82cc52ae2f4f5a830c (diff)
downloaduhd-1ef40895952f94ccd21fca48033b5a14d7e4ff30.tar.gz
uhd-1ef40895952f94ccd21fca48033b5a14d7e4ff30.tar.bz2
uhd-1ef40895952f94ccd21fca48033b5a14d7e4ff30.zip
usrp1: tweaks + implemented other features to mimic async and inline messages
Moved the underflow/overflow polling into a thread and out of the fast-path. Added an inline and async message queue into soft time control. Error and status messages are actually generated now and enqueued. Passes the async message test...
Diffstat (limited to 'host/lib/transport/libusb1_control.cpp')
-rw-r--r--host/lib/transport/libusb1_control.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/host/lib/transport/libusb1_control.cpp b/host/lib/transport/libusb1_control.cpp
index f903907d0..bce3d4b0b 100644
--- a/host/lib/transport/libusb1_control.cpp
+++ b/host/lib/transport/libusb1_control.cpp
@@ -17,6 +17,7 @@
#include "libusb1_base.hpp"
#include <uhd/transport/usb_control.hpp>
+#include <boost/thread/mutex.hpp>
using namespace uhd::transport;
@@ -40,6 +41,7 @@ public:
unsigned char *buff,
boost::uint16_t length
){
+ boost::mutex::scoped_lock lock(_mutex);
return libusb_control_transfer(_handle->get(),
request_type,
request,
@@ -52,6 +54,7 @@ public:
private:
libusb::device_handle::sptr _handle;
+ boost::mutex _mutex;
};
/***********************************************************************