source: rtems/cpukit/score/src/schedulersimplereadyqueueenqueue.c @ 68c6900d

4.115
Last change on this file since 68c6900d was 68c6900d, checked in by Joel Sherrill <joel.sherrill@…>, on 05/12/11 at 13:54:30

2011-05-12 Joel Sherrill <joel.sherrilL@…>

  • score/include/rtems/score/schedulersimple.h, score/inline/rtems/score/schedulersimple.inl, score/src/schedulersimpleenqueue.c, score/src/schedulersimpleenqueuefirst.c, score/src/schedulersimplereadyqueueenqueue.c, score/src/schedulersimplereadyqueueenqueuefirst.c, score/src/schedulersimpleunblock.c: Correct names as pointed out by Gedare.
  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  Schedule Simple Handler / Ready Queue Enqueue
3 *
4 *  COPYRIGHT (c) 2011.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/system.h>
19#include <rtems/score/chain.h>
20#include <rtems/score/isr.h>
21#include <rtems/score/thread.h>
22#include <rtems/score/schedulersimple.h>
23
24void _Scheduler_simple_Ready_queue_enqueue(
25  Thread_Control    *the_thread
26)
27{
28  Chain_Control    *ready;
29  Chain_Node       *the_node;
30  Thread_Control   *current;
31
32  ready    = (Chain_Control *)_Scheduler.information;
33  the_node = _Chain_First( ready );
34  current  = (Thread_Control *)ready;
35
36  for ( ; !_Chain_Is_tail( ready, the_node ) ; the_node = the_node->next ) {
37    current = (Thread_Control *) the_node;
38
39    /* break when AT END OR PAST our priority */
40    if ( the_thread->current_priority < current->current_priority ) {
41      current = (Thread_Control *)current->Object.Node.previous;
42      break;
43    }
44  }
45
46  /* enqueue */
47  _Chain_Insert_unprotected( (Chain_Node *)current, &the_thread->Object.Node );
48}
Note: See TracBrowser for help on using the repository browser.