From 7964a2ba4c7977161d46b1261560163c106ea324 Mon Sep 17 00:00:00 2001
From: Trung N Tran <trung.tran@ettus.com>
Date: Fri, 30 Mar 2018 15:27:34 -0700
Subject: mpmd: tighten reclaiming time.

Reclaming interval was exec_time(claim+dump_logs)+MPMD_RECLAIM_INTERNVAL; this change will
MAX(exec_time(claim+dump_logs),MPM_RECLAIM_INTERVAL)
---
 host/lib/usrp/mpmd/mpmd_mboard_impl.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'host/lib/usrp')

diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
index 8cad29f6b..023d97381 100644
--- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
+++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
@@ -500,12 +500,13 @@ uhd::task::sptr mpmd_mboard_impl::claim_device_and_make_task(
     UHD_LOG_TRACE("MPMD", "Received claim token " << rpc_token);
     rpc->set_token(rpc_token);
     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!");
         };
         this->dump_logs();
-        std::this_thread::sleep_for(
-            std::chrono::milliseconds(MPMD_RECLAIM_INTERVAL_MS)
+        std::this_thread::sleep_until(
+            now + std::chrono::milliseconds(MPMD_RECLAIM_INTERVAL_MS)
         );
     });
 }
-- 
cgit v1.2.3