stack: fix issue where stack thread was exited before stop_impl was called

master
Andre Puschmann 6 years ago
parent 58763fb714
commit 1dea4add2a

@ -171,6 +171,8 @@ private:
mac_metrics_t metrics[SRSLTE_MAX_CARRIERS] = {};
bool initialized = false;
/* Class to process MAC PDUs from DEMUX unit */
class pdu_process : public thread {
public:

@ -88,14 +88,18 @@ bool mac::init(phy_interface_mac_lte* phy, rlc_interface_mac* rlc, rrc_interface
reset();
initialized = true;
return true;
}
void mac::stop()
{
pdu_process_thread.stop();
run_tti(0); // make sure it's not locked after last TTI
if (initialized) {
pdu_process_thread.stop();
run_tti(0); // make sure it's not locked after last TTI
initialized = false;
}
}
void mac::start_pcap(srslte::mac_pcap* pcap_)

@ -130,14 +130,14 @@ void ue_stack_lte::stop()
{
if (running) {
pending_tasks.push([this]() { stop_impl(); });
running = false;
wait_thread_finish();
}
}
void ue_stack_lte::stop_impl()
{
running = false;
usim->stop();
nas.stop();
rrc.stop();

Loading…
Cancel
Save