source: rtems/cpukit/score/src/threadresume.c @ dcf3687

4.115
Last change on this file since dcf3687 was dcf3687, checked in by Joel Sherrill <joel.sherrill@…>, on 01/28/11 at 20:24:54

2011-01-28 Joel Sherrill <joel.sherrilL@…>

  • include/rtems/bspIo.h, include/rtems/concat.h, include/rtems/irq.h, score/cpu/i386/rtems/score/idtr.h, score/cpu/powerpc/rtems/powerpc/registers.h, score/src/objectidtoname.c, score/src/schedulerpriorityblock.c, score/src/schedulerpriorityschedule.c, score/src/schedulerpriorityunblock.c, score/src/schedulerpriorityyield.c, score/src/thread.c, score/src/threadchangepriority.c, score/src/threadclearstate.c, score/src/threadclose.c, score/src/threadcreateidle.c, score/src/threaddelayended.c, score/src/threaddispatch.c, score/src/threadget.c, score/src/threadhandler.c, score/src/threadinitialize.c, score/src/threadloadenv.c, score/src/threadready.c, score/src/threadreset.c, score/src/threadrestart.c, score/src/threadresume.c, score/src/threadsetpriority.c, score/src/threadsetstate.c, score/src/threadsettransient.c, score/src/threadstackallocate.c, score/src/threadstackfree.c, score/src/threadstart.c, score/src/threadstartmultitasking.c, score/src/threadsuspend.c, score/src/threadtickletimeslice.c, score/src/threadyieldprocessor.c: Fix typo where license said found in found in.
  • Property mode set to 100644
File size: 1.8 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 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/scheduler.h>
27#include <rtems/score/states.h>
28#include <rtems/score/sysstate.h>
29#include <rtems/score/thread.h>
30#include <rtems/score/threadq.h>
31#include <rtems/score/userext.h>
32#include <rtems/score/wkspace.h>
33
34/*PAGE
35 *
36 *  _Thread_Resume
37 *
38 *  This kernel routine clears the SUSPEND state if the suspend_count
39 *  drops below one.  If the force parameter is set the suspend_count
40 *  is forced back to zero. The thread ready chain is adjusted if
41 *  necessary and the Heir thread is set accordingly.
42 *
43 *  Input parameters:
44 *    the_thread - pointer to thread control block
45 *    force      - force the suspend count back to 0
46 *
47 *  Output parameters:  NONE
48 *
49 *  INTERRUPT LATENCY:
50 *    priority map
51 *    select heir
52 */
53
54
55void _Thread_Resume(
56  Thread_Control   *the_thread,
57  bool              force
58)
59{
60
61  ISR_Level       level;
62  States_Control  current_state;
63
64  _ISR_Disable( level );
65
66  current_state = the_thread->current_state;
67  if ( current_state & STATES_SUSPENDED ) {
68    current_state =
69    the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state);
70
71    if ( _States_Is_ready( current_state ) ) {
72      _Scheduler_Unblock( &_Scheduler, the_thread );
73    }
74  }
75
76  _ISR_Enable( level );
77}
Note: See TracBrowser for help on using the repository browser.