From 44b6a2b55fe5faf4573bd350ba588364ed367674 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Sat, 29 May 2021 08:39:07 +0200 Subject: [PATCH] Fix SYNC wait for IDLE if the state is reached --- srsue/hdr/phy/sync_state.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srsue/hdr/phy/sync_state.h b/srsue/hdr/phy/sync_state.h index 9e7715026..2c10ebb6c 100644 --- a/srsue/hdr/phy/sync_state.h +++ b/srsue/hdr/phy/sync_state.h @@ -93,7 +93,7 @@ public: // Avoid wasting time if the next state will not be IDLE if (next_state != IDLE) { - return false; + return cur_state == IDLE; } // Calculate timeout @@ -104,9 +104,9 @@ public: while (cur_state != IDLE) { std::cv_status cv_status = cvar.wait_until(lock, expire_time); - // Returns false if it timeouts + // Return if it timeouts if (cv_status != std::cv_status::timeout) { - return false; + return cur_state == IDLE; } }