[srsran-users] possible bur w/r to enb mtch_cvar mutex locking

J Giovatto jgiovatto at adjacentlink.com
Tue Sep 6 13:22:32 UTC 2022


Hi Folks,

I ran across this case where pthread_cond_wait was used w/o the typical 
pthread_mutex_lock/unlock calls

diff --git a/srsenb/src/phy/phy_common.cc b/srsenb/src/phy/phy_common.cc
index 4d8a5428e..f08812ccd 100644
--- a/srsenb/src/phy/phy_common.cc
+++ b/srsenb/src/phy/phy_common.cc
@@ -304,9 +304,11 @@ bool 
phy_common::is_mch_subframe(srsran_mbsfn_cfg_t* cfg, uint32_t phy_tti)
            uint32_t mbsfn_per_frame = 
mbsfn.mcch.pmch_info_list[0].sf_alloc_end /
+enum_to_number(mbsfn.mcch.pmch_info_list[0].mch_sched_period);
            uint32_t sf_alloc_idx = frame_alloc_idx * mbsfn_per_frame + 
((sf < 4) ? sf - 1 : sf - 3);
+          pthread_mutex_lock(&mtch_mutex);
            while (!have_mtch_stop) {
              pthread_cond_wait(&mtch_cvar, &mtch_mutex);
            }
+          pthread_mutex_unlock(&mtch_mutex);
            for (uint32_t i = 0; i < mbsfn.mcch.nof_pmch_info; i++) {
              if (sf_alloc_idx <= mch_period_stop) {
                cfg->mbsfn_mcs = mbsfn.mcch.pmch_info_list[i].data_mcs;


Thoughts ?


Joe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.srsran.com/pipermail/srsran-users/attachments/20220906/62e82077/attachment.sig>


More information about the srsran-users mailing list