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.
This commit is contained in:
Andre Puschmann 2021-07-05 16:10:39 +02:00
parent ec3465bb98
commit 53a7dc78ee
2 changed files with 3 additions and 4 deletions

View File

@ -527,8 +527,8 @@ private:
rlc_ringbuffer_t<rlc_amd_rx_pdu> rx_window;
std::map<uint32_t, rlc_amd_rx_pdu_segments_t> rx_segments;
bool poll_received = false;
bool do_status = false;
bool poll_received = false;
std::atomic<bool> do_status = {false}; // light-weight access from Tx entity
/****************************************************************************
* Timers

View File

@ -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<std::mutex> 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)