aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-17 15:21:11 -0800
committerJosh Blum <josh@joshknows.com>2011-01-17 15:21:11 -0800
commit7e1d02710090c2c1aac971e41a2abb6f68c37d12 (patch)
tree9c3261ac3eebde988030a80f976e68d49516ac65 /host/lib/transport
parentcaa911aa270ee4aef7244f3159b9fd402a454069 (diff)
parentd71344091b324266975b58ec075d896fcb79aeb9 (diff)
downloaduhd-7e1d02710090c2c1aac971e41a2abb6f68c37d12.tar.gz
uhd-7e1d02710090c2c1aac971e41a2abb6f68c37d12.tar.bz2
uhd-7e1d02710090c2c1aac971e41a2abb6f68c37d12.zip
Merge branch 'usrp1' 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 &){}
}
};