source: rtems/cpukit/score/src/threadrestart.c @ eea7c937

4.115
Last change on this file since eea7c937 was 518d82b, checked in by Sebastian Huber <sebastian.huber@…>, on 08/20/13 at 09:01:55

smp: Disable restart of threads other than self

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