source: rtems/cpukit/score/src/threaditerate.c @ 359a3a3

5
Last change on this file since 359a3a3 was 54f35888, checked in by Sebastian Huber <sebastian.huber@…>, on 10/25/18 at 08:54:12

posix: Provide threads by default

Update #2514.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/score/threadimpl.h>
20
21void _Thread_Iterate(
22  Thread_Visitor  visitor,
23  void           *arg
24)
25{
26  int api_index;
27
28  for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; ++api_index ) {
29    const Objects_Information *information;
30    Objects_Maximum            i;
31
32    if ( _Objects_Information_table[ api_index ] == NULL ) {
33      continue;
34    }
35
36    information = _Objects_Information_table[ api_index ][ 1 ];
37
38    if ( information == NULL ) {
39      continue;
40    }
41
42    for ( i = 1 ; i <= information->maximum ; ++i ) {
43      Thread_Control *the_thread;
44
45      the_thread = (Thread_Control *) information->local_table[ i ];
46
47      if ( the_thread != NULL ) {
48        bool done;
49
50        done = (* visitor )( the_thread, arg );
51
52        if ( done ) {
53          return;
54        }
55      }
56    }
57  }
58}
Note: See TracBrowser for help on using the repository browser.