From 1810a2c6a34207caedf5a88bc4e5d38080e764ed Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 21 Apr 2017 00:07:22 +0200 Subject: Put UHD async msg to separate thread --- src/OutputUHD.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/OutputUHD.h') diff --git a/src/OutputUHD.h b/src/OutputUHD.h index cbf159f..d42245f 100644 --- a/src/OutputUHD.h +++ b/src/OutputUHD.h @@ -125,6 +125,8 @@ class UHDWorker { void start(struct UHDWorkerData *uhdworkerdata) { uwd->running = true; uhd_thread = boost::thread(&UHDWorker::process_errhandler, this); + async_rx_thread = boost::thread( + &UHDWorker::print_async_metadata, this); } void stop() { @@ -133,6 +135,7 @@ class UHDWorker { } uhd_thread.interrupt(); uhd_thread.join(); + async_rx_thread.join(); } ~UHDWorker() { @@ -155,13 +158,14 @@ class UHDWorker { // Used to print statistics once a second std::chrono::steady_clock::time_point last_print_time; - void print_async_metadata(const struct UHDWorkerFrameData *frame); + void print_async_metadata(void); void handle_frame(const struct UHDWorkerFrameData *frame); void tx_frame(const struct UHDWorkerFrameData *frame, bool ts_update); struct UHDWorkerData *uwd; boost::thread uhd_thread; + boost::thread async_rx_thread; uhd::tx_streamer::sptr myTxStream; -- cgit v1.2.3