From 6a6d5998f82d97ae754895e3e6f35d3b4bd2cb53 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 22 Nov 2019 10:41:48 -0800 Subject: mpmd: Name the claimer task thread We call set_thread_name() on the claimer loop so the thread can be identified using OS utilities. --- host/lib/usrp/mpmd/mpmd_mboard_impl.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'host/lib/usrp/mpmd') diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp index 98e92e210..4268a90ba 100644 --- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp @@ -372,20 +372,22 @@ uhd::task::sptr mpmd_mboard_impl::claim_device_and_make_task() UHD_LOG_WARNING("MPMD", "Could not read back log queue!"); } } - return uhd::task::make([this] { - auto now = std::chrono::steady_clock::now(); - if (not this->claim()) { - throw uhd::value_error("mpmd device reclaiming loop failed!"); - } else { - try { - this->dump_logs(); - } catch(const uhd::runtime_error&) { - UHD_LOG_WARNING("MPMD", "Could not read back log queue!"); + return uhd::task::make( + [this] { + auto now = std::chrono::steady_clock::now(); + if (not this->claim()) { + throw uhd::value_error("mpmd device reclaiming loop failed!"); + } else { + try { + this->dump_logs(); + } catch (const uhd::runtime_error&) { + UHD_LOG_WARNING("MPMD", "Could not read back log queue!"); + } } - } - std::this_thread::sleep_until( - now + std::chrono::milliseconds(MPMD_RECLAIM_INTERVAL_MS)); - }); + std::this_thread::sleep_until( + now + std::chrono::milliseconds(MPMD_RECLAIM_INTERVAL_MS)); + }, + "mpmd_claimer_task"); } void mpmd_mboard_impl::dump_logs(const bool dump_to_null) -- cgit v1.2.3