5
Last change
on this file since e382a1b was
e382a1b,
checked in by Sebastian Huber <sebastian.huber@…>, on 10/10/16 at 12:33:17
|
score: Pass scheduler node to block operation
Changed for consistency with other scheduler operations.
Update #2556.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Removes a Thread from the Simple Queue |
---|
5 | * |
---|
6 | * @ingroup ScoreScheduler |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 2011. |
---|
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.org/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #if HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include <rtems/score/schedulersimpleimpl.h> |
---|
23 | |
---|
24 | Scheduler_Void_or_thread _Scheduler_simple_Update_priority( |
---|
25 | const Scheduler_Control *scheduler, |
---|
26 | Thread_Control *the_thread, |
---|
27 | Scheduler_Node *node |
---|
28 | ) |
---|
29 | { |
---|
30 | Scheduler_simple_Context *context; |
---|
31 | bool prepend_it; |
---|
32 | |
---|
33 | if ( !_Thread_Is_ready( the_thread ) ) { |
---|
34 | /* Nothing to do */ |
---|
35 | SCHEDULER_RETURN_VOID_OR_NULL; |
---|
36 | } |
---|
37 | |
---|
38 | context = _Scheduler_simple_Get_context( scheduler ); |
---|
39 | _Scheduler_Node_get_priority( node, &prepend_it ); |
---|
40 | |
---|
41 | _Scheduler_simple_Extract( scheduler, the_thread, node ); |
---|
42 | |
---|
43 | if ( prepend_it ) { |
---|
44 | _Scheduler_simple_Insert_priority_lifo( &context->Ready, the_thread ); |
---|
45 | } else { |
---|
46 | _Scheduler_simple_Insert_priority_fifo( &context->Ready, the_thread ); |
---|
47 | } |
---|
48 | |
---|
49 | _Scheduler_simple_Schedule_body( scheduler, the_thread, false ); |
---|
50 | |
---|
51 | SCHEDULER_RETURN_VOID_OR_NULL; |
---|
52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.