From 53a7dc78ee72db1e2f32afcdbd86dbc734cce7a3 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 5 Jul 2021 16:10:39 +0200 Subject: [PATCH] rlc_am_lte: replace do_status boolean with atomic the do_status is queried from the Tx code frequently. To reduce chances to delay the execution because the RLC Rx side is currently holding the mutex we can use an atomic. --- lib/include/srsran/rlc/rlc_am_lte.h | 4 ++-- lib/src/rlc/rlc_am_lte.cc | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/include/srsran/rlc/rlc_am_lte.h b/lib/include/srsran/rlc/rlc_am_lte.h index 6574e8297..4de710f38 100644 --- a/lib/include/srsran/rlc/rlc_am_lte.h +++ b/lib/include/srsran/rlc/rlc_am_lte.h @@ -527,8 +527,8 @@ private: rlc_ringbuffer_t rx_window; std::map rx_segments; - bool poll_received = false; - bool do_status = false; + bool poll_received = false; + std::atomic do_status = {false}; // light-weight access from Tx entity /**************************************************************************** * Timers diff --git a/lib/src/rlc/rlc_am_lte.cc b/lib/src/rlc/rlc_am_lte.cc index 967cf5a55..c0848e5a8 100644 --- a/lib/src/rlc/rlc_am_lte.cc +++ b/lib/src/rlc/rlc_am_lte.cc @@ -1852,8 +1852,7 @@ void rlc_am_lte::rlc_am_lte_rx::reset_status() bool rlc_am_lte::rlc_am_lte_rx::get_do_status() { - std::lock_guard lock(mutex); - return do_status; + return do_status.load(std::memory_order_relaxed); } void rlc_am_lte::rlc_am_lte_rx::write_pdu(uint8_t* payload, const uint32_t nof_bytes)