source: rtems/cpukit/score/src/threadreset.c @ 632e4306

4.104.115
Last change on this file since 632e4306 was 931dd97, checked in by Joel Sherrill <joel.sherrill@…>, on 06/01/09 at 21:44:01

2009-06-01 Joel Sherrill <joel.sherrill@…>

  • score/include/rtems/score/thread.h, score/src/threadinitialize.c, score/src/threadreset.c, score/src/threadresume.c, score/src/threadsuspend.c: Nesting count on thread suspension is only supported from ITRON API so disable if ITRON is disabled.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  Thread Handler
3 *
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/score/apiext.h>
21#include <rtems/score/context.h>
22#include <rtems/score/interr.h>
23#include <rtems/score/isr.h>
24#include <rtems/score/object.h>
25#include <rtems/score/priority.h>
26#include <rtems/score/states.h>
27#include <rtems/score/sysstate.h>
28#include <rtems/score/thread.h>
29#include <rtems/score/threadq.h>
30#include <rtems/score/userext.h>
31#include <rtems/score/wkspace.h>
32
33/*
34 *  _Thread_Reset
35 *
36 *  DESCRIPTION:
37 *
38 *  This routine resets a thread to its initial stat but does
39 *  not actually restart it.  Some APIs do this in separate
40 *  operations and this division helps support this.
41 */
42
43void _Thread_Reset(
44  Thread_Control            *the_thread,
45  void                      *pointer_argument,
46  Thread_Entry_numeric_type  numeric_argument
47)
48{
49  the_thread->resource_count   = 0;
50  #if defined(RTEMS_ITRON_API)
51    the_thread->suspend_count  = 0;
52  #endif
53  the_thread->is_preemptible   = the_thread->Start.is_preemptible;
54  the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
55  the_thread->budget_callout   = the_thread->Start.budget_callout;
56
57  the_thread->Start.pointer_argument = pointer_argument;
58  the_thread->Start.numeric_argument = numeric_argument;
59
60  if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
61
62    if ( _Watchdog_Is_active( &the_thread->Timer ) )
63      (void) _Watchdog_Remove( &the_thread->Timer );
64  }
65
66  if ( the_thread->current_priority != the_thread->Start.initial_priority ) {
67    the_thread->real_priority = the_thread->Start.initial_priority;
68    _Thread_Set_priority( the_thread, the_thread->Start.initial_priority );
69  }
70}
Note: See TracBrowser for help on using the repository browser.