source: rtems/cpukit/score/src/schedulersimplereadyqueueenqueuefirst.c @ 4fc370e

4.115
Last change on this file since 4fc370e was f2f63d1, checked in by Alex Ivanov <alexivanov97@…>, on 11/29/12 at 23:14:28

score misc: Score misc: Clean up Doxygen #7 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

https://google-melange.appspot.com/gci/task/view/google/gci2012/7986214

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief Scheduler Simple Ready Queue Enqueue First
5 *  @ingroup ScoreScheduler
6 */
7
8/*
9 *  COPYRIGHT (c) 2011.
10 *  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.com/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/system.h>
22#include <rtems/score/chain.h>
23#include <rtems/score/thread.h>
24#include <rtems/score/schedulersimple.h>
25
26void _Scheduler_simple_Ready_queue_enqueue_first(
27  Thread_Control    *the_thread
28)
29{
30  Chain_Control    *ready;
31  Chain_Node       *the_node;
32  Thread_Control   *current;
33
34  ready    = (Chain_Control *)_Scheduler.information;
35  current  = (Thread_Control *)ready;
36
37  /*
38   * Do NOT need to check for end of chain because there is always
39   * at least one task on the ready chain -- the IDLE task.  It can
40   * never block, should never attempt to obtain a semaphore or mutex,
41   * and thus will always be there.
42   */
43  for ( the_node = _Chain_First(ready) ; ; the_node = the_node->next ) {
44    current = (Thread_Control *) the_node;
45
46    /* break when AT HEAD OF (or PAST) our priority */
47    if ( the_thread->current_priority <= current->current_priority ) {
48      current = (Thread_Control *)current->Object.Node.previous;
49      break;
50    }
51  }
52
53  /* enqueue */
54  _Chain_Insert_unprotected( (Chain_Node *)current, &the_thread->Object.Node );
55}
Note: See TracBrowser for help on using the repository browser.