From 524008345473def08b2e42848c7a0002af73612c Mon Sep 17 00:00:00 2001 From: yagoda Date: Wed, 5 Apr 2023 13:15:37 +0200 Subject: [PATCH] eMBMS: adding mutex to mbsfn configuration in the eNodeB --- srsenb/hdr/phy/phy_common.h | 1 + srsenb/src/phy/phy_common.cc | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/srsenb/hdr/phy/phy_common.h b/srsenb/hdr/phy/phy_common.h index 3d16c4371..0cb27581c 100644 --- a/srsenb/hdr/phy/phy_common.h +++ b/srsenb/hdr/phy/phy_common.h @@ -301,6 +301,7 @@ private: bool have_mtch_stop = false; std::mutex mtch_mutex; + std::mutex mbsfn_mutex; std::condition_variable mtch_cvar; srsran::phy_cfg_mbsfn_t mbsfn = {}; bool sib13_configured = false; diff --git a/srsenb/src/phy/phy_common.cc b/srsenb/src/phy/phy_common.cc index f5dc8131d..d3bac4986 100644 --- a/srsenb/src/phy/phy_common.cc +++ b/srsenb/src/phy/phy_common.cc @@ -60,9 +60,12 @@ bool phy_common::init(const phy_cell_cfg_list_t& cell_list_, if (!cell_list_lte.empty()) { ue_db.init(stack, params, cell_list_lte); } - if (mcch_configured) { - build_mch_table(); - build_mcch_table(); + { + std::lock_guard lock(mbsfn_mutex); + if (mcch_configured) { + build_mch_table(); + build_mcch_table(); + } } reset(); @@ -168,6 +171,7 @@ void phy_common::set_mch_period_stop(uint32_t stop) void phy_common::configure_mbsfn(srsran::phy_cfg_mbsfn_t* cfg) { + std::lock_guard lock(mbsfn_mutex); mbsfn = *cfg; sib13_configured = true; mcch_configured = true;