From d873eaca5c0dd96827240bf7ab356df4d6d09b62 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Thu, 15 Mar 2018 11:14:22 +0100 Subject: [PATCH] Assign same timer id after release (was not really a bug) --- lib/include/srslte/common/timers.h | 14 +++++++------- srsue/src/upper/rrc.cc | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/include/srslte/common/timers.h b/lib/include/srslte/common/timers.h index d77692d5a..7517aa751 100644 --- a/lib/include/srslte/common/timers.h +++ b/lib/include/srslte/common/timers.h @@ -151,15 +151,15 @@ public: fprintf(stderr, "Error getting unique timer id: no more timers available\n"); return 0; } else { - while(used_timers[next_timer]) { - next_timer++; - if (next_timer >= nof_timers) { - next_timer=0; + for (uint32_t i=0;itimer_get(active[measId].periodic_timer)->stop(); mac_timers->timer_release_id(active[measId].periodic_timer); - log_h->info("MEAS: Removed measId=%d\n", measId); + log_h->info("MEAS: Removed measId=%d, timer_id=%d\n", measId, active[measId].periodic_timer); active.erase(measId); } else { log_h->warning("MEAS: Removing unexistent measId=%d\n", measId); @@ -2846,7 +2846,7 @@ void rrc::rrc_meas::remove_meas_id(uint32_t measId) { void rrc::rrc_meas::remove_meas_id(std::map::iterator it) { mac_timers->timer_get(it->second.periodic_timer)->stop(); mac_timers->timer_release_id(it->second.periodic_timer); - log_h->info("MEAS: Removed measId=%d\n", it->first); + log_h->info("MEAS: Removed measId=%d, timer_id=%d\n", it->first, active[measId].periodic_timer); active.erase(it); }