source: rtems/cpukit/score/src/threaditerate.c @ 8a8b95aa

5
Last change on this file since 8a8b95aa was 1c2d178, checked in by Sebastian Huber <sebastian.huber@…>, on 11/25/18 at 19:15:26

score: Remove Objects_Information::maximum

This information is already present in Objects_Information::maximum_id.
Add and use _Objects_Get_maximum_index().

Update #3621.

  • Property mode set to 100644
File size: 1.3 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            maximum;
31    Objects_Maximum            index;
32
33    if ( _Objects_Information_table[ api_index ] == NULL ) {
34      continue;
35    }
36
37    information = _Objects_Information_table[ api_index ][ 1 ];
38
39    if ( information == NULL ) {
40      continue;
41    }
42
43    maximum = _Objects_Get_maximum_index( information );
44
45    for ( index = 0 ; index < maximum ; ++index ) {
46      Thread_Control *the_thread;
47
48      the_thread = (Thread_Control *) information->local_table[ index ];
49
50      if ( the_thread != NULL ) {
51        bool done;
52
53        done = (* visitor )( the_thread, arg );
54
55        if ( done ) {
56          return;
57        }
58      }
59    }
60  }
61}
Note: See TracBrowser for help on using the repository browser.