source: rtems/cpukit/score/src/scheduleredfunblock.c @ 439c494

4.115
Last change on this file since 439c494 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/**
2 * @file
3 *
4 * @brief Scheduler EDF Unblock
5 * @ingroup ScoreScheduler
6 */
7
8/*
9 *  Copyright (C) 2011 Petr Benes.
10 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/score/scheduleredf.h>
22#include <rtems/score/schedulerimpl.h>
23#include <rtems/score/thread.h>
24
25void _Scheduler_EDF_Unblock(
26  Thread_Control    *the_thread
27)
28{
29  _Scheduler_EDF_Enqueue(the_thread);
30  /* TODO: flash critical section? */
31
32  /*
33   *  If the thread that was unblocked is more important than the heir,
34   *  then we have a new heir.  This may or may not result in a
35   *  context switch.
36   *
37   *  Normal case:
38   *    If the current thread is preemptible, then we need to do
39   *    a context switch.
40   *  Pseudo-ISR case:
41   *    Even if the thread isn't preemptible, if the new heir is
42   *    a pseudo-ISR system task, we need to do a context switch.
43   */
44  if ( _Scheduler_Is_priority_lower_than(
45         _Thread_Heir->current_priority,
46         the_thread->current_priority )) {
47    _Thread_Heir = the_thread;
48    if ( _Thread_Executing->is_preemptible ||
49         the_thread->current_priority == 0 )
50      _Thread_Dispatch_necessary = true;
51  }
52}
Note: See TracBrowser for help on using the repository browser.