1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Extracts Thread from 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/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 | |
---|
31 | void _Thread_queue_Extract( |
---|
32 | Thread_queue_Control *the_thread_queue, |
---|
33 | Thread_Control *the_thread |
---|
34 | ) |
---|
35 | { |
---|
36 | /* |
---|
37 | * Can not use indirect function pointer here since Extract priority |
---|
38 | * is a macro and the underlying methods do not have the same signature. |
---|
39 | */ |
---|
40 | if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) |
---|
41 | _Thread_queue_Extract_priority( the_thread_queue, the_thread ); |
---|
42 | else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ |
---|
43 | _Thread_queue_Extract_fifo( the_thread_queue, the_thread ); |
---|
44 | |
---|
45 | } |
---|