Use blocking queue for RRC measurement fixes #193

master
Ismael Gomez 7 years ago
parent 04609cd07d
commit 4515dd94ea

@ -86,6 +86,10 @@ public:
while (try_pop(item)); while (try_pop(item));
} }
size_t size() {
return q.size();
}
private: private:
std::queue<myobj> q; std::queue<myobj> q;
pthread_mutex_t mutex; pthread_mutex_t mutex;

@ -547,7 +547,7 @@ private:
void process_phy_meas(); void process_phy_meas();
void process_new_phy_meas(phy_meas_t meas); void process_new_phy_meas(phy_meas_t meas);
std::queue<phy_meas_t> phy_meas_q; srslte::block_queue<phy_meas_t> phy_meas_q;
// Cell selection/reselection functions/variables // Cell selection/reselection functions/variables
typedef struct { typedef struct {

@ -534,10 +534,10 @@ void rrc::new_phy_meas(float rsrp, float rsrq, uint32_t tti, int earfcn_i, int p
/* Processes all pending PHY measurements in queue. Must be called from a mutexed function /* Processes all pending PHY measurements in queue. Must be called from a mutexed function
*/ */
void rrc::process_phy_meas() { void rrc::process_phy_meas() {
while(!phy_meas_q.empty()) { phy_meas_t m;
while(phy_meas_q.try_pop(&m)) {
rrc_log->debug("MEAS: Processing measurement. %lu measurements in queue\n", phy_meas_q.size()); rrc_log->debug("MEAS: Processing measurement. %lu measurements in queue\n", phy_meas_q.size());
process_new_phy_meas(phy_meas_q.front()); process_new_phy_meas(m);
phy_meas_q.pop();
} }
} }

Loading…
Cancel
Save