From c33928d2bbdd27688c3475e77fc461e7d16eba5a Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Tue, 18 Apr 2017 16:46:44 -0700 Subject: utils: add set_thread_name API call, move thread_priority to thread --- host/examples/benchmark_rate.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'host/examples/benchmark_rate.cpp') diff --git a/host/examples/benchmark_rate.cpp b/host/examples/benchmark_rate.cpp index 80fc0be6c..cb2cf251c 100644 --- a/host/examples/benchmark_rate.cpp +++ b/host/examples/benchmark_rate.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . // -#include +#include #include #include #include @@ -451,7 +451,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ uhd::stream_args_t stream_args(rx_cpu, rx_otw); stream_args.channels = rx_channel_nums; uhd::rx_streamer::sptr rx_stream = usrp->get_rx_stream(stream_args); - thread_group.create_thread(boost::bind(&benchmark_rx_rate, usrp, rx_cpu, rx_stream, random_nsamps, boost::ref(burst_timer_elapsed))); + auto rx_thread = thread_group.create_thread(boost::bind(&benchmark_rx_rate, usrp, rx_cpu, rx_stream, random_nsamps, boost::ref(burst_timer_elapsed))); + uhd::set_thread_name(rx_thread, "bmark_rx_stream"); } //spawn the transmit test thread @@ -461,8 +462,10 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ uhd::stream_args_t stream_args(tx_cpu, tx_otw); stream_args.channels = tx_channel_nums; uhd::tx_streamer::sptr tx_stream = usrp->get_tx_stream(stream_args); - thread_group.create_thread(boost::bind(&benchmark_tx_rate, usrp, tx_cpu, tx_stream, boost::ref(burst_timer_elapsed), random_nsamps)); - thread_group.create_thread(boost::bind(&benchmark_tx_rate_async_helper, tx_stream, boost::ref(burst_timer_elapsed))); + auto tx_thread = thread_group.create_thread(boost::bind(&benchmark_tx_rate, usrp, tx_cpu, tx_stream, boost::ref(burst_timer_elapsed), random_nsamps)); + uhd::set_thread_name(tx_thread, "bmark_tx_stream"); + auto tx_async_thread = thread_group.create_thread(boost::bind(&benchmark_tx_rate_async_helper, tx_stream, boost::ref(burst_timer_elapsed))); + uhd::set_thread_name(tx_async_thread, "bmark_tx_helper"); } //sleep for the required duration -- cgit v1.2.3