diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-10-31 13:37:59 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-02 08:46:47 +0100 |
commit | d271c3bb78f86dd9417a964b019b8e38911064fa (patch) | |
tree | 3c36b87c580464cc7f1e5aec89e1137a68759da3 /cpukit/rtems/include/rtems/rtems/tasks.h | |
parent | posix: Fix timer interval (diff) | |
download | rtems-d271c3bb78f86dd9417a964b019b8e38911064fa.tar.bz2 |
rtems: Add rtems_task_iterate()
Update #2423.
Diffstat (limited to '')
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/tasks.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h index 0eaaeca4a3..180e50eed7 100644 --- a/cpukit/rtems/include/rtems/rtems/tasks.h +++ b/cpukit/rtems/include/rtems/rtems/tasks.h @@ -513,6 +513,38 @@ rtems_status_code rtems_task_set_scheduler( rtems_id rtems_task_self(void); /** + * @brief Task visitor. + * + * @param[in] tcb The task control block. + * @param[in] arg The visitor argument. + * + * @retval true Stop the iteration. + * @retval false Otherwise. + * + * @see rtems_task_iterate(). + */ +typedef bool ( *rtems_task_visitor )( rtems_tcb *tcb, void *arg ); + +/** + * @brief Iterates over all tasks in the system. + * + * This operation covers all tasks of all APIs. + * + * Must be called from task context. This operation obtains and releases the + * objects allocator lock. The task visitor is called while owning the objects + * allocator lock. It is possible to perform blocking operations in the task + * visitor, however, take care that no deadlocks via the object allocator lock + * can occur. + * + * @param[in] visitor The task visitor. + * @param[in] arg The visitor argument. + */ +void rtems_task_iterate( + rtems_task_visitor visitor, + void *arg +); + +/** * @brief Identifies a scheduler by its name. * * The scheduler name is determined by the scheduler configuration. |