From 40e572f85a596eebdbc6add920f734e560294b19 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 13 Apr 2007 22:34:16 +0000 Subject: [PATCH] 2007-04-13 Joel Sherrill * user/task.t: Add rtems_iterate_over_all_threads. --- doc/ChangeLog | 5 +++++ doc/user/task.t | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 30d0da1eab..5c580d9b25 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2007-04-13 Joel Sherrill + + * user/task.t: Add rtems_iterate_over_all_threads. + 2007-03-10 Joel Sherrill PR 1226/cpukit @@ -41,6 +45,7 @@ * porting/interrupts.t: Fix bogus _CPU_ISR_Get_level. +2006-09-07 Ken Peters 2006-09-07 Ken Peters PR 1171/doc diff --git a/doc/user/task.t b/doc/user/task.t index 115536eb22..8e814a3959 100644 --- a/doc/user/task.t +++ b/doc/user/task.t @@ -31,6 +31,7 @@ by the task manager are: @item @code{@value{DIRPREFIX}task_set_note} - Set task notepad entry @item @code{@value{DIRPREFIX}task_wake_after} - Wake up after interval @item @code{@value{DIRPREFIX}task_wake_when} - Wake up when specified +@item @code{@value{DIRPREFIX}iterate_over_all_threads} - Iterate Over Tasks @item @code{@value{DIRPREFIX}task_variable_add} - Associate per task variable @item @code{@value{DIRPREFIX}task_variable_get} - Obtain value of a a per task variable @item @code{@value{DIRPREFIX}task_variable_delete} - Remove per task variable @@ -1610,6 +1611,51 @@ A clock tick is required to support the functionality of this directive. @page +@subsection ITERATE_OVER_ALL_THREADS - Iterate Over Tasks + +@cindex iterate over all threads +@subheading CALLING SEQUENCE: + +@ifset is-C +@findex rtems_iterate_over_all_threads +@example +typedef void (*rtems_per_thread_routine)( + Thread_Control *the_thread +); + +void rtems_iterate_over_all_threads( + rtems_per_thread_routine routine +); +@end example +@end ifset + +@ifset is-Ada +@example +NOT SUPPORTED FROM Ada +@end example +@end ifset + +@subheading DIRECTIVE STATUS CODES: NONE + + +@subheading DESCRIPTION: + +This directive iterates over all of the existant threads in the +system and invokes @code{routine} on each of them. The user should +be careful in accessing the contents of @code{the_thread}. + +This routine is intended for use in diagnostic utilities and is +not intented for routine use in an operational system. + +@subheading NOTES: + +There is NO protection while this routine is called. Thus it is +possible that @code{the_thread} could be deleted while this is operating. +By not having protection, the user is free to invoke support routines +from the C Library which require semaphores for data structures. + +@page + @subsection TASK_VARIABLE_ADD - Associate per task variable @cindex per-task variable