source: rtems/cpukit/score/src/threadsetstate.c @ 8ae37323

4.115
Last change on this file since 8ae37323 was 92635cb, checked in by Sebastian Huber <sebastian.huber@…>, on 06/03/14 at 14:27:53

score: Remove scheduler parameter from most ops

Remove the scheduler parameter from most high level scheduler operations
like

  • _Scheduler_Block(),
  • _Scheduler_Unblock(),
  • _Scheduler_Change_priority(),
  • _Scheduler_Update_priority(),
  • _Scheduler_Release_job(), and
  • _Scheduler_Yield().

This simplifies the scheduler operations usage.

  • Property mode set to 100644
File size: 973 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Sets States for a Thread
5 *
6 * @ingroup ScoreThread
7 */
8
9/*
10 *  Thread Handler / Thread Set State
11 *
12 *  COPYRIGHT (c) 1989-2011.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.org/license/LICENSE.
18 */
19
20#if HAVE_CONFIG_H
21#include "config.h"
22#endif
23
24#include <rtems/score/threadimpl.h>
25#include <rtems/score/isrlevel.h>
26#include <rtems/score/schedulerimpl.h>
27
28void _Thread_Set_state(
29  Thread_Control *the_thread,
30  States_Control  state
31)
32{
33  ISR_Level      level;
34  States_Control current_state;
35
36  _ISR_Disable( level );
37
38  current_state = the_thread->current_state;
39  if ( _States_Is_ready( current_state ) ) {
40    the_thread->current_state = state;
41
42    _Scheduler_Block( the_thread );
43  } else {
44    the_thread->current_state = _States_Set( state, current_state);
45  }
46
47  _ISR_Enable( level );
48}
Note: See TracBrowser for help on using the repository browser.