aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1/io_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-07-13 17:25:40 -0700
committerJosh Blum <josh@joshknows.com>2011-07-13 17:25:40 -0700
commit7e1b2a0e3c014bc23aaa7a045efb5f1109818051 (patch)
tree748f2f0cb78d133a478f61a14b7a18a4de560673 /host/lib/usrp/usrp1/io_impl.cpp
parent9d470d5db39c75308f3ac15a8512f08b714b4ee4 (diff)
downloaduhd-7e1b2a0e3c014bc23aaa7a045efb5f1109818051.tar.gz
uhd-7e1b2a0e3c014bc23aaa7a045efb5f1109818051.tar.bz2
uhd-7e1b2a0e3c014bc23aaa7a045efb5f1109818051.zip
uhd: added tasks to simplify thread spawning use cases
Diffstat (limited to 'host/lib/usrp/usrp1/io_impl.cpp')
-rw-r--r--host/lib/usrp/usrp1/io_impl.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp
index b596bbd04..e81b00d1c 100644
--- a/host/lib/usrp/usrp1/io_impl.cpp
+++ b/host/lib/usrp/usrp1/io_impl.cpp
@@ -24,6 +24,7 @@
#include "usrp_commands.h"
#include "usrp1_impl.hpp"
#include <uhd/utils/msg.hpp>
+#include <uhd/utils/tasks.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/transport/bounded_buffer.hpp>
#include <boost/math/special_functions/sign.hpp>
@@ -131,8 +132,6 @@ struct usrp1_impl::io_impl{
}
~io_impl(void){
- vandal_tribe.interrupt_all();
- vandal_tribe.join_all();
UHD_SAFE_CALL(flush_send_buff();)
}
@@ -159,7 +158,7 @@ struct usrp1_impl::io_impl{
return omsb.get_new(curr_buff, next_buff);
}
- boost::thread_group vandal_tribe;
+ task::sptr vandal_task;
boost::system_time last_send_time;
};
@@ -230,12 +229,9 @@ void usrp1_impl::io_init(void){
_io_impl = UHD_PIMPL_MAKE(io_impl, (_data_transport));
//create a new vandal thread to poll xerflow conditions
- boost::barrier spawn_barrier(2);
- _io_impl->vandal_tribe.create_thread(boost::bind(
- &usrp1_impl::vandal_conquest_loop,
- this, boost::ref(spawn_barrier)
+ _io_impl->vandal_task = task::make(boost::bind(
+ &usrp1_impl::vandal_conquest_loop, this
));
- spawn_barrier.wait();
//init some handler stuff
_io_impl->recv_handler.set_tick_rate(_master_clock_rate);
@@ -277,8 +273,7 @@ void usrp1_impl::tx_stream_on_off(bool enb){
* On an overflow, interleave an inline message into recv and print.
* This procedure creates "soft" inline and async user messages.
*/
-void usrp1_impl::vandal_conquest_loop(boost::barrier &spawn_barrier){
- spawn_barrier.wait();
+void usrp1_impl::vandal_conquest_loop(void){
//initialize the async metadata
async_metadata_t async_metadata;