5
Last change
on this file since 33829ce was
33829ce,
checked in by Sebastian Huber <sebastian.huber@…>, on 05/13/16 at 12:07:23
|
score: Avoid Giant lock for _Thread_Start()
Update #2555.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief RTEMS Start Task |
---|
5 | * @ingroup ClassicTasks Tasks |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2014. |
---|
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.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <rtems/rtems/tasks.h> |
---|
22 | #include <rtems/score/threadimpl.h> |
---|
23 | |
---|
24 | rtems_status_code rtems_task_start( |
---|
25 | rtems_id id, |
---|
26 | rtems_task_entry entry_point, |
---|
27 | rtems_task_argument argument |
---|
28 | ) |
---|
29 | { |
---|
30 | Thread_Entry_information entry = { |
---|
31 | .adaptor = _Thread_Entry_adaptor_numeric, |
---|
32 | .Kinds = { |
---|
33 | .Numeric = { |
---|
34 | .entry = entry_point, |
---|
35 | .argument = argument |
---|
36 | } |
---|
37 | } |
---|
38 | }; |
---|
39 | Thread_Control *the_thread; |
---|
40 | ISR_lock_Context lock_context; |
---|
41 | bool ok; |
---|
42 | |
---|
43 | the_thread = _Thread_Get_interrupt_disable( id, &lock_context ); |
---|
44 | |
---|
45 | if ( the_thread == NULL ) { |
---|
46 | #if defined(RTEMS_MULTIPROCESSING) |
---|
47 | if ( _Thread_MP_Is_remote( id ) ) { |
---|
48 | return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; |
---|
49 | } |
---|
50 | #endif |
---|
51 | |
---|
52 | return RTEMS_INVALID_ID; |
---|
53 | } |
---|
54 | |
---|
55 | ok = _Thread_Start( the_thread, &entry, &lock_context ); |
---|
56 | |
---|
57 | return ok ? RTEMS_SUCCESSFUL : RTEMS_INCORRECT_STATE; |
---|
58 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.