rlc: protect access to tx_enabled

master
Ismael Gomez 3 years ago
parent bf566fbd29
commit 80c48a8b01

@ -387,6 +387,8 @@ private:
void set_bsr_callback(bsr_callback_t callback); void set_bsr_callback(bsr_callback_t callback);
private: private:
void stop_nolock();
int build_status_pdu(uint8_t* payload, uint32_t nof_bytes); int build_status_pdu(uint8_t* payload, uint32_t nof_bytes);
int build_retx_pdu(uint8_t* payload, uint32_t nof_bytes); int build_retx_pdu(uint8_t* payload, uint32_t nof_bytes);
int build_segment(uint8_t* payload, uint32_t nof_bytes, rlc_amd_retx_t retx); int build_segment(uint8_t* payload, uint32_t nof_bytes, rlc_amd_retx_t retx);

@ -343,7 +343,11 @@ bool rlc_am_lte::rlc_am_lte_tx::configure(const rlc_config_t& cfg_)
void rlc_am_lte::rlc_am_lte_tx::stop() void rlc_am_lte::rlc_am_lte_tx::stop()
{ {
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
stop_nolock();
}
void rlc_am_lte::rlc_am_lte_tx::stop_nolock()
{
empty_queue_nolock(); empty_queue_nolock();
tx_enabled = false; tx_enabled = false;
@ -396,7 +400,8 @@ void rlc_am_lte::rlc_am_lte_tx::empty_queue_nolock()
void rlc_am_lte::rlc_am_lte_tx::reestablish() void rlc_am_lte::rlc_am_lte_tx::reestablish()
{ {
stop(); std::lock_guard<std::mutex> lock(mutex);
stop_nolock();
tx_enabled = true; tx_enabled = true;
} }

Loading…
Cancel
Save