srsenb,phy: do not get reference to ul_grants, do a copy instead to protect concurrent access

master
Ismael Gomez 3 years ago
parent 80c48a8b01
commit 09cec9ca5c

@ -227,7 +227,7 @@ public:
void set_mch_period_stop(uint32_t stop); void set_mch_period_stop(uint32_t stop);
// Getters and setters for ul grants which need to be shared between workers // Getters and setters for ul grants which need to be shared between workers
const stack_interface_phy_lte::ul_sched_list_t& get_ul_grants(uint32_t tti); const stack_interface_phy_lte::ul_sched_list_t get_ul_grants(uint32_t tti);
void set_ul_grants(uint32_t tti, const stack_interface_phy_lte::ul_sched_list_t& ul_grants); void set_ul_grants(uint32_t tti, const stack_interface_phy_lte::ul_sched_list_t& ul_grants);
void clear_grants(uint16_t rnti); void clear_grants(uint16_t rnti);

@ -85,7 +85,7 @@ void phy_common::clear_grants(uint16_t rnti)
} }
} }
const stack_interface_phy_lte::ul_sched_list_t& phy_common::get_ul_grants(uint32_t tti) const stack_interface_phy_lte::ul_sched_list_t phy_common::get_ul_grants(uint32_t tti)
{ {
std::lock_guard<std::mutex> lock(grant_mutex); std::lock_guard<std::mutex> lock(grant_mutex);
return ul_grants[tti]; return ul_grants[tti];

Loading…
Cancel
Save