source: rtems/cpukit/score/src/threaditerate.c @ e0dcf294

Last change on this file since e0dcf294 was e0dcf294, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 5, 2019 at 7:58:07 AM

Remove superfluous run-time check

The _Objects_Information_table[ the_api ] is never NULL for a valid API
index.

  • 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    _Assert( _Objects_Information_table[ api_index ] != NULL );
34    information = _Objects_Information_table[ api_index ][ 1 ];
35
36    if ( information == NULL ) {
37      continue;
38    }
39
40    maximum = _Objects_Get_maximum_index( information );
41
42    for ( index = 0 ; index < maximum ; ++index ) {
43      Thread_Control *the_thread;
44
45      the_thread = (Thread_Control *) information->local_table[ index ];
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.