source: rtems/cpukit/score/src/scheduleredfyield.c @ 40ee2fc0

4.115
Last change on this file since 40ee2fc0 was 40ee2fc0, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 20, 2011 at 1:06:42 PM

2011-09-20 Petr Benes <benesp16@…>

PR 1916/testing

  • rtems/src/ratemondelete.c, score/src/schedulercbsreleasejob.c, score/src/scheduleredfupdate.c, score/src/scheduleredfyield.c: Rework to improve coverage.
  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  Copyright (C) 2011 Petr Benes.
3 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems/system.h>
17#include <rtems/score/isr.h>
18#include <rtems/score/scheduler.h>
19#include <rtems/score/scheduleredf.h>
20#include <rtems/score/thread.h>
21
22void _Scheduler_EDF_Yield(void)
23{
24  ISR_Level                 level;
25
26  Thread_Control *executing  = _Thread_Executing;
27  Scheduler_EDF_Per_thread *executing_info =
28    (Scheduler_EDF_Per_thread *) executing->scheduler_info;
29  RBTree_Node *executing_node = &(executing_info->Node);
30
31  _ISR_Disable( level );
32
33  /*
34   * The RBTree has more than one node, enqueue behind the tasks
35   * with the same priority in case there are such ones.
36   */
37  _RBTree_Extract( &_Scheduler_EDF_Ready_queue, executing_node );
38  _RBTree_Insert( &_Scheduler_EDF_Ready_queue, executing_node );
39
40  _ISR_Flash( level );
41
42  _Scheduler_EDF_Schedule();
43  _Thread_Dispatch_necessary = true;
44
45  _ISR_Enable( level );
46}
Note: See TracBrowser for help on using the repository browser.