5
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Iterates Over All Threads |
---|
5 | * @ingroup ScoreThread |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2010. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <rtems/score/threadimpl.h> |
---|
22 | |
---|
23 | typedef struct { |
---|
24 | rtems_per_thread_routine routine; |
---|
25 | } routine_arg; |
---|
26 | |
---|
27 | static bool routine_adaptor( rtems_tcb *tcb, void *arg ) |
---|
28 | { |
---|
29 | routine_arg *ra; |
---|
30 | |
---|
31 | ra = arg; |
---|
32 | ( *ra->routine )( tcb ); |
---|
33 | return false; |
---|
34 | } |
---|
35 | |
---|
36 | void rtems_iterate_over_all_threads( rtems_per_thread_routine routine ) |
---|
37 | { |
---|
38 | routine_arg arg = { |
---|
39 | .routine = routine |
---|
40 | }; |
---|
41 | |
---|
42 | if ( routine != NULL ) { |
---|
43 | _Thread_Iterate( routine_adaptor, &arg ); |
---|
44 | } |
---|
45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.