aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/benchmark_rate.cpp
diff options
context:
space:
mode:
authorAndrej Rode <andrej.rode@ettus.com>2017-04-18 16:46:44 -0700
committerMartin Braun <martin.braun@ettus.com>2017-06-29 13:43:05 -0700
commitc33928d2bbdd27688c3475e77fc461e7d16eba5a (patch)
treed5bffc49696e2bc03c9b8576864e387373b950fb /host/examples/benchmark_rate.cpp
parent47cdd6319c74a7b823843aad5ff3fa370ed1e6ef (diff)
downloaduhd-c33928d2bbdd27688c3475e77fc461e7d16eba5a.tar.gz
uhd-c33928d2bbdd27688c3475e77fc461e7d16eba5a.tar.bz2
uhd-c33928d2bbdd27688c3475e77fc461e7d16eba5a.zip
utils: add set_thread_name API call, move thread_priority to thread
Diffstat (limited to 'host/examples/benchmark_rate.cpp')
-rw-r--r--host/examples/benchmark_rate.cpp11
1 files changed, 7 insertions, 4 deletions
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 <http://www.gnu.org/licenses/>.
//
-#include <uhd/utils/thread_priority.hpp>
+#include <uhd/utils/thread.hpp>
#include <uhd/convert.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/usrp/multi_usrp.hpp>
@@ -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