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
This commit is contained in:
Andre Puschmann 2021-04-10 12:29:22 +02:00
parent cf696138d3
commit c1b66e89a5
1 changed files with 3 additions and 0 deletions

View File

@ -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<std::mutex> lock(mutex);
// initialize MAC PDU
srsran::unique_byte_buffer_t phy_tx_pdu = srsran::make_byte_buffer();
if (phy_tx_pdu == nullptr) {