aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorVirendra Kakade <virendra.kakade@ni.com>2019-02-27 20:11:07 -0600
committermichael-west <michael.west@ettus.com>2019-05-21 17:20:42 -0700
commit3e82c285759dedc9355161f953f71f7c7ac11f6b (patch)
treee1df78671d846cfeb68ae66b8d97db874b56defc /host/lib/usrp
parent2960e559515348dce83bfdbdd6ef39e551235045 (diff)
downloaduhd-3e82c285759dedc9355161f953f71f7c7ac11f6b.tar.gz
uhd-3e82c285759dedc9355161f953f71f7c7ac11f6b.tar.bz2
uhd-3e82c285759dedc9355161f953f71f7c7ac11f6b.zip
mpmd: Fix spurious reclaim call after unclaim
The reclaim task loop is asnychronous to the main thread which can result in spurious reclaim call to the device after unclaim has been called. This is especially risky if the device has already entered a non-serviceable state after unclaim e.g. idle state. Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/mpmd/mpmd_mboard_impl.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
index da4f99794..e2d347778 100644
--- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
+++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
@@ -302,9 +302,12 @@ mpmd_mboard_impl::mpmd_mboard_impl(
mpmd_mboard_impl::~mpmd_mboard_impl()
{
- UHD_SAFE_CALL(dump_logs(); if (not rpc->request_with_token<bool>("unclaim")) {
- UHD_LOG_WARNING("MPMD", "Failure to ack unclaim!");
- });
+ // Destroy the claimer task to avoid spurious asynchronous reclaim call after the
+ // unclaim.
+ UHD_SAFE_CALL(dump_logs(); _claimer_task.reset();
+ if (not rpc->request_with_token<bool>("unclaim")) {
+ UHD_LOG_WARNING("MPMD", "Failure to ack unclaim!");
+ });
}
/*****************************************************************************