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 Thread Queue Requeue |
---|
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/score/threadqimpl.h> |
---|
22 | #include <rtems/score/statesimpl.h> |
---|
23 | |
---|
24 | void _Thread_queue_Requeue( |
---|
25 | Thread_queue_Control *the_thread_queue, |
---|
26 | Thread_Control *the_thread |
---|
27 | ) |
---|
28 | { |
---|
29 | /* |
---|
30 | * Just in case the thread really wasn't blocked on a thread queue |
---|
31 | * when we get here. |
---|
32 | */ |
---|
33 | if ( !the_thread_queue ) |
---|
34 | return; |
---|
35 | |
---|
36 | /* |
---|
37 | * If queueing by FIFO, there is nothing to do. This only applies to |
---|
38 | * priority blocking discipline. |
---|
39 | */ |
---|
40 | if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { |
---|
41 | Thread_queue_Control *tq = the_thread_queue; |
---|
42 | ISR_Level level; |
---|
43 | ISR_Level level_ignored; |
---|
44 | |
---|
45 | _ISR_Disable( level ); |
---|
46 | if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { |
---|
47 | _Thread_queue_Enter_critical_section( tq ); |
---|
48 | _Thread_queue_Extract_priority_helper( tq, the_thread, true ); |
---|
49 | (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); |
---|
50 | } |
---|
51 | _ISR_Enable( level ); |
---|
52 | } |
---|
53 | } |
---|
54 | |
---|
Note: See
TracBrowser
for help on using the repository browser.