source: rtems/cpukit/score/src/threadreset.c @ fa6b0f5

4.104.114.84.95
Last change on this file since fa6b0f5 was a8eed23, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/27/05 at 05:57:05

Include config.h.

  • 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  uint32_t             numeric_argument
47)
48{
49  the_thread->resource_count   = 0;
50  the_thread->suspend_count    = 0;
51  the_thread->is_preemptible   = the_thread->Start.is_preemptible;
52  the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
53  the_thread->budget_callout   = the_thread->Start.budget_callout;
54
55  the_thread->Start.pointer_argument = pointer_argument;
56  the_thread->Start.numeric_argument = numeric_argument;
57
58  if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
59
60    if ( _Watchdog_Is_active( &the_thread->Timer ) )
61      (void) _Watchdog_Remove( &the_thread->Timer );
62  }
63
64  if ( the_thread->current_priority != the_thread->Start.initial_priority ) {
65    the_thread->real_priority = the_thread->Start.initial_priority;
66    _Thread_Set_priority( the_thread, the_thread->Start.initial_priority );
67  }
68}
Note: See TracBrowser for help on using the repository browser.