source: rtems/cpukit/score/src/threadqdequeue.c @ a936aa49

4.115
Last change on this file since a936aa49 was d4d7899, checked in by Christopher Kerl <zargyyoyo@…>, on 11/28/12 at 19:31:53

score misc: Clean up Doxygen #2 (GCI 2012)

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

http://www.google-melange.com/gci/task/view/google/gci2012/7986213

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 * @file
3 *
4 * @brief Thread Queue Dequeue
5 *
6 * @ingroup ScoreThreadQ
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2008.
11 *  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/system.h>
23#include <rtems/score/chain.h>
24#include <rtems/score/isr.h>
25#include <rtems/score/object.h>
26#include <rtems/score/states.h>
27#include <rtems/score/thread.h>
28#include <rtems/score/threadq.h>
29#include <rtems/score/tqdata.h>
30
31Thread_Control *_Thread_queue_Dequeue(
32  Thread_queue_Control *the_thread_queue
33)
34{
35  Thread_Control *(*dequeue_p)( Thread_queue_Control * );
36  Thread_Control *the_thread;
37  ISR_Level       level;
38  Thread_blocking_operation_States  sync_state;
39
40  if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY )
41    dequeue_p = _Thread_queue_Dequeue_priority;
42  else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */
43    dequeue_p = _Thread_queue_Dequeue_fifo;
44
45  the_thread = (*dequeue_p)( the_thread_queue );
46  _ISR_Disable( level );
47    if ( !the_thread ) {
48      sync_state = the_thread_queue->sync_state;
49      if ( (sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
50           (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) {
51        the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
52        the_thread = _Thread_Executing;
53      }
54    }
55  _ISR_Enable( level );
56  return the_thread;
57}
Note: See TracBrowser for help on using the repository browser.