diff --git a/lib/include/srslte/common/move_callback.h b/lib/include/srslte/common/move_callback.h index fd7686b77..46c9194d1 100644 --- a/lib/include/srslte/common/move_callback.h +++ b/lib/include/srslte/common/move_callback.h @@ -165,6 +165,9 @@ private: template constexpr task_details::empty_table_t move_callback::empty_table; +//! Generic move task +using move_task_t = move_callback; + } // namespace srslte #endif // SRSLTE_MOVE_CALLBACK_H diff --git a/lib/include/srslte/common/multiqueue.h b/lib/include/srslte/common/multiqueue.h index 47ab2869a..b56c168e3 100644 --- a/lib/include/srslte/common/multiqueue.h +++ b/lib/include/srslte/common/multiqueue.h @@ -302,38 +302,7 @@ private: uint32_t nof_threads_waiting = 0; }; -/*********************************************************** - * Specialization for tasks with content that is move-only - **********************************************************/ - -template -class move_function -{ -public: - move_function() = default; - template - move_function(Func&& f) : task_ptr(new derived_task(std::forward(f))) - {} - void operator()(Args&&... args) { (*task_ptr)(std::forward(args)...); } - -private: - struct base_task { - virtual ~base_task() {} - virtual void operator()(Args&&...) = 0; - }; - template - struct derived_task : public base_task { - derived_task(Func&& f_) : f(std::forward(f_)) {} - void operator()(Args&&... args) final { f(std::forward(args)...); } - - private: - Func f; - }; - - std::unique_ptr task_ptr; -}; - -using move_task_t = move_callback; +//! Specialization for tasks using task_multiqueue = multiqueue_handler; } // namespace srslte diff --git a/lib/include/srslte/common/stack_procedure.h b/lib/include/srslte/common/stack_procedure.h index 9f57272da..f49b7b2d1 100644 --- a/lib/include/srslte/common/stack_procedure.h +++ b/lib/include/srslte/common/stack_procedure.h @@ -19,7 +19,7 @@ * */ -#include "srslte/common/multiqueue.h" +#include "srslte/common/move_callback.h" #include #include #include @@ -74,7 +74,7 @@ class callback_group_t { public: using callback_id_t = uint32_t; - using callback_t = srslte::move_function; + using callback_t = srslte::move_callback; //! register callback, that gets called once callback_id_t on_next_call(callback_t f_) diff --git a/lib/include/srslte/interfaces/enb_interfaces.h b/lib/include/srslte/interfaces/enb_interfaces.h index f9116331c..f27844c91 100644 --- a/lib/include/srslte/interfaces/enb_interfaces.h +++ b/lib/include/srslte/interfaces/enb_interfaces.h @@ -28,7 +28,6 @@ #include "srslte/asn1/s1ap_asn1.h" #include "srslte/common/common.h" #include "srslte/common/interfaces_common.h" -#include "srslte/common/multiqueue.h" #include "srslte/common/security.h" #include "srslte/interfaces/sched_interface.h" #include diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index 44b9d96a0..9695482b9 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -38,7 +38,6 @@ #include "srslte/asn1/liblte_mme.h" #include "srslte/common/common.h" #include "srslte/common/interfaces_common.h" -#include "srslte/common/multiqueue.h" #include "srslte/common/security.h" #include "srslte/common/stack_procedure.h" #include "srslte/common/tti_point.h" diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index 11191b0d7..729d9405d 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -518,10 +518,7 @@ bool nas::paging(s_tmsi_t* ue_identity) return false; } // once completed, call paging complete - rrc_connector.then([this](proc_state_t outcome) { - rrc->paging_completed(outcome.is_success()); - return proc_outcome_t::success; - }); + rrc_connector.then([this](proc_state_t outcome) { rrc->paging_completed(outcome.is_success()); }); callbacks.add_proc(rrc_connector); } else { nas_log->warning("Received paging while in state %s\n", emm_state_text[state]);