source: rtems/cpukit/score/src/threadqdequeuefifo.c @ e0f91da

4.115
Last change on this file since e0f91da was e0f91da, checked in by Alex Ivanov <alexivanov97@…>, on 11/30/12 at 21:34:17

score misc: Score misc: Clean up Doxygen #9 (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/7977211

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief Thread Queue Dequeue FIFO
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.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/isr.h>
24#include <rtems/score/object.h>
25#include <rtems/score/states.h>
26#include <rtems/score/thread.h>
27#include <rtems/score/threadq.h>
28#include <rtems/score/tqdata.h>
29
30Thread_Control *_Thread_queue_Dequeue_fifo(
31  Thread_queue_Control *the_thread_queue
32)
33{
34  ISR_Level              level;
35  Thread_Control *the_thread;
36
37  _ISR_Disable( level );
38  if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) ) {
39
40    the_thread = (Thread_Control *)
41       _Chain_Get_first_unprotected( &the_thread_queue->Queues.Fifo );
42
43    the_thread->Wait.queue = NULL;
44    if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
45      _ISR_Enable( level );
46      _Thread_Unblock( the_thread );
47    } else {
48      _Watchdog_Deactivate( &the_thread->Timer );
49      _ISR_Enable( level );
50      (void) _Watchdog_Remove( &the_thread->Timer );
51      _Thread_Unblock( the_thread );
52    }
53
54#if defined(RTEMS_MULTIPROCESSING)
55    if ( !_Objects_Is_local_id( the_thread->Object.id ) )
56      _Thread_MP_Free_proxy( the_thread );
57#endif
58
59    return the_thread;
60  }
61
62  _ISR_Enable( level );
63  return NULL;
64}
Note: See TracBrowser for help on using the repository browser.