aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2011-01-17 22:52:41 -0800
committerNick Foster <nick@nerdnetworks.org>2011-01-17 22:52:41 -0800
commit24c3565f9f887045e414652edffd6b5536f8c7a5 (patch)
treea0e40a679d6a029268fc2a328f3643c40a9e880b /host/lib/transport
parent330a014dfc32b34a7fe5555d3ae2d87a25dc2466 (diff)
parent37116e6c5be8e2660b9dd165e04ea1af4087f1f0 (diff)
downloaduhd-24c3565f9f887045e414652edffd6b5536f8c7a5.tar.gz
uhd-24c3565f9f887045e414652edffd6b5536f8c7a5.tar.bz2
uhd-24c3565f9f887045e414652edffd6b5536f8c7a5.zip
Merge branch 'next' of ettus.sourcerepo.com:ettus/uhdpriv into next
Diffstat (limited to 'host/lib/transport')
-rw-r--r--host/lib/transport/libusb1_zero_copy.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp
index 806d923e9..adc590284 100644
--- a/host/lib/transport/libusb1_zero_copy.cpp
+++ b/host/lib/transport/libusb1_zero_copy.cpp
@@ -134,7 +134,6 @@ static void callback(libusb_transfer *lut){
* \param pointer to libusb_transfer
*/
void usb_endpoint::callback_handle_transfer(libusb_transfer *lut){
- boost::this_thread::disable_interruption di; //disable because the wait can throw
_completed_list->push_with_wait(lut);
}
@@ -272,7 +271,6 @@ void usb_endpoint::print_transfer_status(libusb_transfer *lut){
}
libusb_transfer *usb_endpoint::get_lut_with_wait(double timeout){
- boost::this_thread::disable_interruption di; //disable because the wait can throw
libusb_transfer *lut;
if (_completed_list->pop_with_timed_wait(lut, timeout)) return lut;
return NULL;
@@ -293,6 +291,7 @@ public:
~libusb_zero_copy_impl(void){
_threads_running = false;
+ _thread_group.interrupt_all();
_thread_group.join_all();
}
@@ -333,12 +332,14 @@ private:
set_thread_priority_safe();
libusb::session::sptr session = libusb::session::get_global_session();
_threads_running = true;
- while(_threads_running){
- timeval tv;
- tv.tv_sec = 0;
- tv.tv_usec = 100000; //100ms
- libusb_handle_events_timeout(session->get_context(), &tv);
- }
+ try{
+ while(_threads_running){
+ timeval tv;
+ tv.tv_sec = 0;
+ tv.tv_usec = 100000; //100ms
+ libusb_handle_events_timeout(session->get_context(), &tv);
+ }
+ } catch(const boost::thread_interrupted &){}
}
};