source: rtems/c/src/exec/score/src/threadrestart.c @ d3fdf459

4.104.114.84.95
Last change on this file since d3fdf459 was d3fdf459, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 16, 1999 at 4:09:50 PM

Now use _Thread_Reset().

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  Thread Handler
3 *
4 *
5 *  COPYRIGHT (c) 1989-1998.
6 *  On-Line Applications Research Corporation (OAR).
7 *  Copyright assigned to U.S. Government, 1994.
8 *
9 *  The license and distribution terms for this file may be
10 *  found in found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#include <rtems/system.h>
17#include <rtems/score/apiext.h>
18#include <rtems/score/context.h>
19#include <rtems/score/interr.h>
20#include <rtems/score/isr.h>
21#include <rtems/score/object.h>
22#include <rtems/score/priority.h>
23#include <rtems/score/states.h>
24#include <rtems/score/sysstate.h>
25#include <rtems/score/thread.h>
26#include <rtems/score/threadq.h>
27#include <rtems/score/userext.h>
28#include <rtems/score/wkspace.h>
29
30/*
31 *  _Thread_Restart
32 *
33 *  DESCRIPTION:
34 *
35 *  This support routine restarts the specified task in a way that the
36 *  next time this thread executes, it will begin execution at its
37 *  original starting point.
38 */
39 
40boolean _Thread_Restart(
41  Thread_Control      *the_thread,
42  void                *pointer_argument,
43  unsigned32           numeric_argument
44)
45{
46  if ( !_States_Is_dormant( the_thread->current_state ) ) {
47 
48    _Thread_Set_transient( the_thread );
49
50    _Thread_Reset( the_thread, pointer_argument, numeric_argument );
51 
52    _Thread_Load_environment( the_thread );
53 
54    _Thread_Ready( the_thread );
55 
56    _User_extensions_Thread_restart( the_thread );
57 
58    if ( _Thread_Is_executing ( the_thread ) )
59      _Thread_Restart_self();
60 
61    return TRUE;
62  }
63 
64  return FALSE;
65}
Note: See TracBrowser for help on using the repository browser.