From 07cb60e3f9eb5b8ac07c5849a262fe2ffc57833b Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 19 Apr 2022 12:29:39 +0200 Subject: [PATCH] gnb,mac: protect RACH counter --- srsgnb/src/stack/mac/mac_nr.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/srsgnb/src/stack/mac/mac_nr.cc b/srsgnb/src/stack/mac/mac_nr.cc index 91674f814..8423e99eb 100644 --- a/srsgnb/src/stack/mac/mac_nr.cc +++ b/srsgnb/src/stack/mac/mac_nr.cc @@ -339,7 +339,10 @@ void mac_nr::rach_detected(const rach_info_t& rach_info) uint16_t rnti = alloc_ue(enb_cc_idx); // Log this event. - ++detected_rachs[enb_cc_idx]; + { + srsran::rwlock_write_guard lock(rwmutex); + ++detected_rachs[enb_cc_idx]; + } // Trigger scheduler RACH srsenb::sched_nr_interface::rar_info_t rar_info = {};