Assign same timer id after release (was not really a bug)

master
Ismael Gomez 7 years ago
parent f470645e90
commit d873eaca5c

@ -151,15 +151,15 @@ public:
fprintf(stderr, "Error getting unique timer id: no more timers available\n"); fprintf(stderr, "Error getting unique timer id: no more timers available\n");
return 0; return 0;
} else { } else {
while(used_timers[next_timer]) { for (uint32_t i=0;i<nof_timers;i++) {
next_timer++; if (!used_timers[i]) {
if (next_timer >= nof_timers) { nof_used_timers++;
next_timer=0; return i;
} }
} }
used_timers[next_timer] = true; fprintf(stderr, "Error getting unique timer id: no more timers available but nof_used_timers=%d, nof_timers=%d\n",
nof_used_timers++; nof_used_timers, nof_timers);
return next_timer; return 0;
} }
} }
private: private:

@ -2836,7 +2836,7 @@ void rrc::rrc_meas::remove_meas_id(uint32_t measId) {
if (active.count(measId)) { if (active.count(measId)) {
mac_timers->timer_get(active[measId].periodic_timer)->stop(); mac_timers->timer_get(active[measId].periodic_timer)->stop();
mac_timers->timer_release_id(active[measId].periodic_timer); 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); active.erase(measId);
} else { } else {
log_h->warning("MEAS: Removing unexistent measId=%d\n", measId); 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<uint32_t, meas_t>::iterator it) { void rrc::rrc_meas::remove_meas_id(std::map<uint32_t, meas_t>::iterator it) {
mac_timers->timer_get(it->second.periodic_timer)->stop(); mac_timers->timer_get(it->second.periodic_timer)->stop();
mac_timers->timer_release_id(it->second.periodic_timer); 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); active.erase(it);
} }

Loading…
Cancel
Save