source: rtems/cpukit/score/src/threadclearstate.c @ 5472ad41

4.115
Last change on this file since 5472ad41 was 010192d, checked in by Joel Sherrill <joel.sherrill@…>, on 02/17/11 at 22:21:44

2011-02-17 Joel Sherrill <joel.sherrill@…>

  • sapi/include/confdefs.h, sapi/include/rtems/config.h, score/include/rtems/score/scheduler.h, score/include/rtems/score/schedulerpriority.h, score/inline/rtems/score/scheduler.inl, score/inline/rtems/score/schedulerpriority.inl, score/src/scheduler.c, score/src/schedulerpriority.c, score/src/schedulerpriorityblock.c, score/src/schedulerpriorityschedule.c, score/src/schedulerprioritythreadschedulerallocate.c, score/src/schedulerprioritythreadschedulerfree.c, score/src/schedulerprioritythreadschedulerupdate.c, score/src/schedulerpriorityunblock.c, score/src/schedulerpriorityyield.c, score/src/threadchangepriority.c, score/src/threadclearstate.c, score/src/threadclose.c, score/src/threadinitialize.c, score/src/threadready.c, score/src/threadresume.c, score/src/threadsetpriority.c, score/src/threadsetstate.c, score/src/threadsuspend.c: Simplify the pluggable scheduler interface. Its configuration made a table of available schedulers and set a pointer to one of the. This was heavy handed since you can only use one scheduler in an application. This configuration mechanism resulted in a scheduler pointer being passed around when you could put all scheduler configuration in an initialized structure.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  Thread Handler / Thread Clear State
3 *
4 *  COPYRIGHT (c) 1989-2011.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/system.h>
19#include <rtems/score/apiext.h>
20#include <rtems/score/context.h>
21#include <rtems/score/interr.h>
22#include <rtems/score/isr.h>
23#include <rtems/score/object.h>
24#include <rtems/score/priority.h>
25#include <rtems/score/scheduler.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 *  INTERRUPT LATENCY:
35 *    priority map
36 *    select heir
37 */
38void _Thread_Clear_state(
39  Thread_Control *the_thread,
40  States_Control  state
41)
42{
43  ISR_Level       level;
44  States_Control  current_state;
45
46  _ISR_Disable( level );
47    current_state = the_thread->current_state;
48
49    if ( current_state & state ) {
50      current_state =
51      the_thread->current_state = _States_Clear( state, current_state );
52
53      if ( _States_Is_ready( current_state ) ) {
54        _Scheduler_Unblock( the_thread );
55      }
56  }
57  _ISR_Enable( level );
58}
Note: See TracBrowser for help on using the repository browser.