From c1b66e89a585819fde0c49335412b157f538dde9 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Sat, 10 Apr 2021 12:29:22 +0200 Subject: [PATCH] mux_nr: protect MAC PDU packing from concurrent access from PHY workers this will be moved to UL HARQ shortly but for now we need to protect the packing --- srsue/src/stack/mac_nr/mux_nr.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/srsue/src/stack/mac_nr/mux_nr.cc b/srsue/src/stack/mac_nr/mux_nr.cc index d0eff00ae..d829a3174 100644 --- a/srsue/src/stack/mac_nr/mux_nr.cc +++ b/srsue/src/stack/mac_nr/mux_nr.cc @@ -42,6 +42,9 @@ int mux_nr::setup_lcid(const srsran::logical_channel_config_t& config) srsran::unique_byte_buffer_t mux_nr::get_pdu(uint32_t max_pdu_len) { + // Lock MAC PDU from current access from PHY workers (will be moved to UL HARQ) + std::lock_guard lock(mutex); + // initialize MAC PDU srsran::unique_byte_buffer_t phy_tx_pdu = srsran::make_byte_buffer(); if (phy_tx_pdu == nullptr) {