source: rtems/cpukit/score/src/threadstart.c @ 5618c37a

4.115
Last change on this file since 5618c37a was 5618c37a, checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 13:14:48

score: Create thread implementation header

Move implementation specific parts of thread.h and thread.inl into new
header file threadimpl.h. The thread.h contains now only the
application visible API.

Remove superfluous header file includes from various files.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/**
2 * @file
3 *
4 * @brief Initializes Thread and Executes it
5 *
6 * @ingroup ScoreThread
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-1999.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/score/threadimpl.h>
23#include <rtems/score/isrlevel.h>
24#include <rtems/score/schedulerimpl.h>
25#include <rtems/score/userextimpl.h>
26
27bool _Thread_Start(
28  Thread_Control            *the_thread,
29  Thread_Start_types         the_prototype,
30  void                      *entry_point,
31  void                      *pointer_argument,
32  Thread_Entry_numeric_type  numeric_argument,
33  Per_CPU_Control           *processor
34)
35{
36  if ( _States_Is_dormant( the_thread->current_state ) ) {
37
38    the_thread->Start.entry_point      = (Thread_Entry) entry_point;
39
40    the_thread->Start.prototype        = the_prototype;
41    the_thread->Start.pointer_argument = pointer_argument;
42    the_thread->Start.numeric_argument = numeric_argument;
43
44    _Thread_Load_environment( the_thread );
45
46    if ( processor == NULL ) {
47      _Thread_Ready( the_thread );
48    } else {
49      the_thread->current_state = STATES_READY;
50      _Scheduler_Start_idle( the_thread, processor );
51    }
52
53    _User_extensions_Thread_start( the_thread );
54
55    return true;
56  }
57
58  return false;
59}
Note: See TracBrowser for help on using the repository browser.