moved cell search completed signal from the background thread to the stack thread

master
Francisco Paisana 5 years ago committed by Andre Puschmann
parent ba6a68825c
commit e67f66e539

@ -170,8 +170,8 @@ private:
void operator()() { func(this); } void operator()() { func(this); }
}; };
srslte::multiqueue_handler<task_t> pending_tasks; srslte::multiqueue_handler<task_t> pending_tasks;
int sync_queue_id = -1, ue_queue_id = -1, gw_queue_id = -1, mac_queue_id = -1; int sync_queue_id = -1, ue_queue_id = -1, gw_queue_id = -1, mac_queue_id = -1, background_queue_id = -1;
srslte::task_thread_pool background_tasks; ///< Thread pool used for long, low-priority tasks srslte::task_thread_pool background_tasks; ///< Thread pool used for long, low-priority tasks
}; };
} // namespace srsue } // namespace srsue

@ -43,9 +43,10 @@ ue_stack_lte::ue_stack_lte() :
background_tasks(2) background_tasks(2)
{ {
ue_queue_id = pending_tasks.add_queue(); ue_queue_id = pending_tasks.add_queue();
sync_queue_id = pending_tasks.add_queue(); sync_queue_id = pending_tasks.add_queue();
gw_queue_id = pending_tasks.add_queue(); gw_queue_id = pending_tasks.add_queue();
mac_queue_id = pending_tasks.add_queue(); mac_queue_id = pending_tasks.add_queue();
background_queue_id = pending_tasks.add_queue();
background_tasks.start(); background_tasks.start();
} }
@ -313,7 +314,8 @@ void ue_stack_lte::start_cell_search()
phy_interface_rrc_lte::phy_cell_t found_cell; phy_interface_rrc_lte::phy_cell_t found_cell;
phy_interface_rrc_lte::cell_search_ret_t ret = phy->cell_search(&found_cell); phy_interface_rrc_lte::cell_search_ret_t ret = phy->cell_search(&found_cell);
// notify back RRC // notify back RRC
rrc.cell_search_completed(ret, found_cell); pending_tasks.push(background_queue_id,
task_t{[this, found_cell, ret](task_t*) { rrc.cell_search_completed(ret, found_cell); }});
}); });
} }

Loading…
Cancel
Save