5
Last change
on this file since 8a8b95aa was
088acbb0,
checked in by Sebastian Huber <sebastian.huber@…>, on 03/07/17 at 12:07:02
|
score: Fix scheduler yield in SMP configurations
Check that no ask help request is registered during unblock and yield
scheduler operations. There is no need to ask for help if a scheduled
thread yields, since this is already covered by the pre-emption
detection.
Update #2556.
|
-
Property mode set to
100644
|
File size:
920 bytes
|
Line | |
---|
1 | /* |
---|
2 | * Copyright (c) 2014, 2017 embedded brains GmbH. |
---|
3 | * |
---|
4 | * The license and distribution terms for this file may be |
---|
5 | * found in the file LICENSE in this distribution or at |
---|
6 | * http://www.rtems.org/license/LICENSE. |
---|
7 | */ |
---|
8 | |
---|
9 | #if HAVE_CONFIG_H |
---|
10 | #include "config.h" |
---|
11 | #endif |
---|
12 | |
---|
13 | #include <rtems/score/schedulersmpimpl.h> |
---|
14 | |
---|
15 | void _Scheduler_Request_ask_for_help( Thread_Control *the_thread ) |
---|
16 | { |
---|
17 | ISR_lock_Context lock_context; |
---|
18 | |
---|
19 | _Thread_Scheduler_acquire_critical( the_thread, &lock_context ); |
---|
20 | |
---|
21 | if ( _Chain_Is_node_off_chain( &the_thread->Scheduler.Help_node ) ) { |
---|
22 | Per_CPU_Control *cpu; |
---|
23 | |
---|
24 | cpu = _Thread_Get_CPU( the_thread ); |
---|
25 | _Per_CPU_Acquire( cpu ); |
---|
26 | |
---|
27 | _Chain_Append_unprotected( |
---|
28 | &cpu->Threads_in_need_for_help, |
---|
29 | &the_thread->Scheduler.Help_node |
---|
30 | ); |
---|
31 | |
---|
32 | _Per_CPU_Release( cpu ); |
---|
33 | |
---|
34 | _Thread_Dispatch_request( _Per_CPU_Get(), cpu ); |
---|
35 | } |
---|
36 | |
---|
37 | _Thread_Scheduler_release_critical( the_thread, &lock_context ); |
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.