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.
master
Andre Puschmann 4 years ago
parent ec3465bb98
commit 53a7dc78ee

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

@ -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)

Loading…
Cancel
Save