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

4.115
Last change on this file since eea7c937 was eea7c937, checked in by Sebastian Huber <sebastian.huber@…>, on 11/19/13 at 15:09:17

scheduler/EDF: Use unprotected insert and extract

Interrupts are disabled by the caller _Thread_Change_priority() or
_Thread_Set_transient() or directly in the scheduler operation. Thus
there is no need to use protected variants.

  • Property mode set to 100644
File size: 1.1 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/score/scheduleredfimpl.h>
23
24void _Scheduler_EDF_Yield( Thread_Control *thread )
25{
26  ISR_Level                 level;
27
28  Scheduler_EDF_Per_thread *thread_info =
29    (Scheduler_EDF_Per_thread *) thread->scheduler_info;
30  RBTree_Node *thread_node = &(thread_info->Node);
31
32  _ISR_Disable( level );
33
34  /*
35   * The RBTree has more than one node, enqueue behind the tasks
36   * with the same priority in case there are such ones.
37   */
38  _RBTree_Extract_unprotected( &_Scheduler_EDF_Ready_queue, thread_node );
39  _RBTree_Insert_unprotected( &_Scheduler_EDF_Ready_queue, thread_node );
40
41  _ISR_Flash( level );
42
43  _Scheduler_EDF_Schedule_body( thread, false );
44
45  _ISR_Enable( level );
46}
Note: See TracBrowser for help on using the repository browser.