diff --git a/srsue/hdr/stack/ue_stack_lte.h b/srsue/hdr/stack/ue_stack_lte.h index c4d966f4d..eccb23217 100644 --- a/srsue/hdr/stack/ue_stack_lte.h +++ b/srsue/hdr/stack/ue_stack_lte.h @@ -170,8 +170,8 @@ private: void operator()() { func(this); } }; srslte::multiqueue_handler pending_tasks; - int sync_queue_id = -1, ue_queue_id = -1, gw_queue_id = -1, mac_queue_id = -1; - srslte::task_thread_pool background_tasks; ///< Thread pool used for long, low-priority tasks + 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 }; } // namespace srsue diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index 103352433..cbb95e8df 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -43,9 +43,10 @@ ue_stack_lte::ue_stack_lte() : background_tasks(2) { ue_queue_id = pending_tasks.add_queue(); - sync_queue_id = pending_tasks.add_queue(); - gw_queue_id = pending_tasks.add_queue(); - mac_queue_id = pending_tasks.add_queue(); + sync_queue_id = pending_tasks.add_queue(); + gw_queue_id = pending_tasks.add_queue(); + mac_queue_id = pending_tasks.add_queue(); + background_queue_id = pending_tasks.add_queue(); 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::cell_search_ret_t ret = phy->cell_search(&found_cell); // 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); }}); }); }