source: rtems/cpukit/posix/src/pthreadinitthreads.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2008.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 */
9
10#if HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <errno.h>
15#include <pthread.h>
16#include <limits.h>
17
18#include <rtems/system.h>
19#include <rtems/config.h>
20#include <rtems/score/apiext.h>
21#include <rtems/score/stack.h>
22#include <rtems/score/thread.h>
23#include <rtems/score/userext.h>
24#include <rtems/score/wkspace.h>
25#include <rtems/posix/cancel.h>
26#include <rtems/posix/pthread.h>
27#include <rtems/posix/priority.h>
28#include <rtems/posix/psignal.h>
29#include <rtems/posix/config.h>
30#include <rtems/posix/key.h>
31#include <rtems/posix/time.h>
32
33/*
34 *  _POSIX_Threads_Initialize_user_threads_body
35 *
36 *  This routine creates and starts all configured user
37 *  initialization threads.
38 *
39 *  Input parameters: NONE
40 *
41 *  Output parameters:  NONE
42 */
43
44void _POSIX_Threads_Initialize_user_threads_body(void)
45{
46  int                                 status;
47  uint32_t                            index;
48  uint32_t                            maximum;
49  posix_initialization_threads_table *user_threads;
50  pthread_t                           thread_id;
51  pthread_attr_t                      attr;
52
53  user_threads = Configuration_POSIX_API.User_initialization_threads_table;
54  maximum      = Configuration_POSIX_API.number_of_initialization_threads;
55
56  if ( !user_threads || maximum == 0 )
57    return;
58
59  /*
60   *  Be careful .. if the default attribute set changes, this may need to.
61   *
62   *  Setting the attributes explicitly is critical, since we don't want
63   *  to inherit the idle tasks attributes.
64   */
65
66  for ( index=0 ; index < maximum ; index++ ) {
67    /*
68     * There is no way for these calls to fail in this situation.
69     */
70    (void) pthread_attr_init( &attr );
71    (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
72    (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
73
74    status = pthread_create(
75      &thread_id,
76      &attr,
77      user_threads[ index ].thread_entry,
78      NULL
79    );
80    if ( status )
81      _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
82  }
83}
84
Note: See TracBrowser for help on using the repository browser.