source: rtems/cpukit/score/src/scheduleredfyield.c @ f031df0e

4.115
Last change on this file since f031df0e was 6eba7c85, checked in by Sebastian Huber <sebastian.huber@…>, on 06/10/13 at 14:15:46

scheduler: Specify thread of yield operation

The yielding thread of the yield operation is now specified by a
parameter. The tick operation may be performed for each executing
thread in a SMP configuration.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file
3 *
4 * @brief Scheduler EDF Yield
5 *
6 * @ingroup ScoreScheduler
7 */
8
9/*
10 *  Copyright (C) 2011 Petr Benes.
11 *  Copyright (C) 2011 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.com/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/system.h>
23#include <rtems/score/isr.h>
24#include <rtems/score/scheduler.h>
25#include <rtems/score/scheduleredf.h>
26#include <rtems/score/thread.h>
27
28void _Scheduler_EDF_Yield( Thread_Control *thread )
29{
30  ISR_Level                 level;
31
32  Scheduler_EDF_Per_thread *thread_info =
33    (Scheduler_EDF_Per_thread *) thread->scheduler_info;
34  RBTree_Node *thread_node = &(thread_info->Node);
35
36  _ISR_Disable( level );
37
38  /*
39   * The RBTree has more than one node, enqueue behind the tasks
40   * with the same priority in case there are such ones.
41   */
42  _RBTree_Extract( &_Scheduler_EDF_Ready_queue, thread_node );
43  _RBTree_Insert( &_Scheduler_EDF_Ready_queue, thread_node );
44
45  _ISR_Flash( level );
46
47  _Scheduler_EDF_Schedule();
48  _Thread_Dispatch_necessary = true;
49
50  _ISR_Enable( level );
51}
Note: See TracBrowser for help on using the repository browser.