source: rtems/cpukit/score/src/threadsettransient.c @ 24934e36

4.115
Last change on this file since 24934e36 was 24934e36, checked in by Sebastian Huber <sebastian.huber@…>, on 04/03/14 at 13:03:35

score: Add scheduler control to scheduler ops

Scheduler operations must be free of a global scheduler context to
enable partitioned/clustered scheduling.

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