source: rtems/cpukit/score/src/threadq.c @ 25f5730f

4.11
Last change on this file since 25f5730f was 1fac361, checked in by Sebastian Huber <sebastian.huber@…>, on Mar 24, 2014 at 7:51:37 AM

score: PR2174: Add workaround

Add _Scheduler_FIXME_thread_priority_queues_are_broken to prevent thread
priority queues in case an EDF scheduler is used.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief Thread Queue Initialize
5 *  @ingroup ScoreThreadQ
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2008.
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.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/score/threadqimpl.h>
22#include <rtems/score/chainimpl.h>
23#include <rtems/score/scheduler.h>
24
25void _Thread_queue_Initialize(
26  Thread_queue_Control         *the_thread_queue,
27  Thread_queue_Disciplines      the_discipline,
28  States_Control                state,
29  uint32_t                      timeout_status
30)
31{
32  if ( _Scheduler_FIXME_thread_priority_queues_are_broken ) {
33    the_discipline = THREAD_QUEUE_DISCIPLINE_FIFO;
34  }
35
36  the_thread_queue->state          = state;
37  the_thread_queue->discipline     = the_discipline;
38  the_thread_queue->timeout_status = timeout_status;
39  the_thread_queue->sync_state     = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
40
41  if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
42    uint32_t   index;
43
44    for( index=0 ;
45         index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ;
46         index++)
47      _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] );
48  } else { /* must be THREAD_QUEUE_DISCIPLINE_FIFO */
49    _Chain_Initialize_empty( &the_thread_queue->Queues.Fifo );
50  }
51
52}
Note: See TracBrowser for help on using the repository browser.