|
|
@ -118,19 +118,19 @@ private:
|
|
|
|
void run_all_internal_tasks()
|
|
|
|
void run_all_internal_tasks()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Perform pending stack deferred tasks
|
|
|
|
// Perform pending stack deferred tasks
|
|
|
|
// Note: Keep it indexed-based, bc a task may enqueue another task, which may cause vector reallocation,
|
|
|
|
// Note: Using a deque because tasks can enqueue new tasks, which would lead to
|
|
|
|
// and iterator invalidation
|
|
|
|
// reference invalidation in case of vector
|
|
|
|
for (size_t i = 0; i < internal_tasks.size(); ++i) {
|
|
|
|
while (not internal_tasks.empty()) {
|
|
|
|
internal_tasks[i]();
|
|
|
|
internal_tasks.front()();
|
|
|
|
|
|
|
|
internal_tasks.pop_front();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
internal_tasks.clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
int background_queue_id = -1; ///< Queue for handling the outcomes of tasks run in the background
|
|
|
|
int background_queue_id = -1; ///< Queue for handling the outcomes of tasks run in the background
|
|
|
|
srslte::task_multiqueue external_tasks;
|
|
|
|
srslte::task_multiqueue external_tasks;
|
|
|
|
srslte::timer_handler timers;
|
|
|
|
srslte::timer_handler timers;
|
|
|
|
std::vector<srslte::move_task_t> internal_tasks; ///< enqueues stack tasks from within main thread. Avoids locking
|
|
|
|
std::deque<srslte::move_task_t> internal_tasks; ///< enqueues stack tasks from within main thread. Avoids locking
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//! Task scheduler handle given to classes/functions running within the main control thread
|
|
|
|
//! Task scheduler handle given to classes/functions running within the main control thread
|
|
|
|