source: rtems/cpukit/score/src/threadqextractfifo.c @ f031df0e

4.115
Last change on this file since f031df0e was a112364, checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 15:30:26

score: Create threadq implementation header

Move implementation specific parts of tqdata.h, threadq.h and
threadq.inl into new header file threadqimpl.h. The threadq.h contains
now only the application visible API.

Delete tqdata.h.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief Removes a Thread from a Thread  Queue
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/score/threadqimpl.h>
23#include <rtems/score/chainimpl.h>
24#include <rtems/score/isrlevel.h>
25#include <rtems/score/threadimpl.h>
26#include <rtems/score/watchdogimpl.h>
27
28void _Thread_queue_Extract_fifo(
29  Thread_queue_Control *the_thread_queue __attribute__((unused)),
30  Thread_Control       *the_thread
31)
32{
33  ISR_Level level;
34
35  _ISR_Disable( level );
36
37  if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
38    _ISR_Enable( level );
39    return;
40  }
41
42  _Chain_Extract_unprotected( &the_thread->Object.Node );
43
44  the_thread->Wait.queue = NULL;
45
46  if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
47    _ISR_Enable( level );
48  } else {
49    _Watchdog_Deactivate( &the_thread->Timer );
50    _ISR_Enable( level );
51    (void) _Watchdog_Remove( &the_thread->Timer );
52  }
53
54  _Thread_Unblock( the_thread );
55
56#if defined(RTEMS_MULTIPROCESSING)
57  if ( !_Objects_Is_local_id( the_thread->Object.id ) )
58    _Thread_MP_Free_proxy( the_thread );
59#endif
60
61}
Note: See TracBrowser for help on using the repository browser.