5
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Removes a Thread from the Simple Queue |
---|
5 | * |
---|
6 | * @ingroup RTEMSScoreScheduler |
---|
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 | void _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 | unsigned int new_priority; |
---|
32 | |
---|
33 | if ( !_Thread_Is_ready( the_thread ) ) { |
---|
34 | /* Nothing to do */ |
---|
35 | return; |
---|
36 | } |
---|
37 | |
---|
38 | context = _Scheduler_simple_Get_context( scheduler ); |
---|
39 | new_priority = (unsigned int ) _Scheduler_Node_get_priority( node ); |
---|
40 | |
---|
41 | _Scheduler_simple_Extract( scheduler, the_thread, node ); |
---|
42 | _Scheduler_simple_Insert( &context->Ready, the_thread, new_priority ); |
---|
43 | _Scheduler_simple_Schedule_body( scheduler, the_thread, false ); |
---|
44 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.