aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-06-16 11:50:05 -0700
committerJosh Blum <josh@joshknows.com>2011-06-16 11:50:05 -0700
commit927e795da332fc0903c311d07bdd0344efe31a95 (patch)
tree13a76cc424470dbc809064a5caac2f800286dda0
parent335e9ae544995ec98687438539d1f5704f3dceff (diff)
downloaduhd-927e795da332fc0903c311d07bdd0344efe31a95.tar.gz
uhd-927e795da332fc0903c311d07bdd0344efe31a95.tar.bz2
uhd-927e795da332fc0903c311d07bdd0344efe31a95.zip
uhd: replaced boolean for thread loop w/ boost::this_thread::interruption_requested
-rw-r--r--host/lib/transport/libusb1_zero_copy.cpp5
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp5
2 files changed, 2 insertions, 8 deletions
diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp
index 19a7a3742..f781f890d 100644
--- a/host/lib/transport/libusb1_zero_copy.cpp
+++ b/host/lib/transport/libusb1_zero_copy.cpp
@@ -222,7 +222,6 @@ public:
}
}
//shutdown the threads
- _threads_running = false;
_thread_group.interrupt_all();
_thread_group.join_all();
}
@@ -277,15 +276,13 @@ private:
//! event handler threads
boost::thread_group _thread_group;
- bool _threads_running;
void run_event_loop(boost::barrier &spawn_barrier){
- _threads_running = true;
spawn_barrier.wait();
set_thread_priority_safe();
libusb_context *context = libusb::session::get_global_session()->get_context();
try{
- while(_threads_running){
+ while (not boost::this_thread::interruption_requested()){
timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 100000; //100ms
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index ffe9a88e7..df452942c 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -146,7 +146,6 @@ struct usrp2_impl::io_impl{
}
~io_impl(void){
- recv_pirate_crew_raiding = false;
recv_pirate_crew.interrupt_all();
recv_pirate_crew.join_all();
}
@@ -185,7 +184,6 @@ struct usrp2_impl::io_impl{
//methods and variables for the pirate crew
void recv_pirate_loop(boost::barrier &, usrp2_mboard_impl::sptr, zero_copy_if::sptr, size_t);
boost::thread_group recv_pirate_crew;
- bool recv_pirate_crew_raiding;
bounded_buffer<async_metadata_t> async_msg_fifo;
};
@@ -201,14 +199,13 @@ void usrp2_impl::io_impl::recv_pirate_loop(
zero_copy_if::sptr err_xport,
size_t index
){
- recv_pirate_crew_raiding = true;
spawn_barrier.wait();
set_thread_priority_safe();
//store a reference to the flow control monitor (offset by max dsps)
flow_control_monitor &fc_mon = *(this->fc_mons[index*usrp2_mboard_impl::MAX_NUM_DSPS]);
- while(recv_pirate_crew_raiding){
+ while (not boost::this_thread::interruption_requested()){
managed_recv_buffer::sptr buff = err_xport->get_recv_buff();
if (not buff.get()) continue; //ignore timeout/error buffers