source:
rtems/cpukit/rtems/src/taskresume.c
@
66cb142
Last change on this file since 66cb142 was e266d13, checked in by Sebastian Huber <sebastian.huber@…>, on 05/20/16 at 13:10:27 | |
---|---|
|
|
File size: 1.1 KB |
Rev | Line | |
---|---|---|
[c18e0ba] | 1 | /** |
2 | * @file | |
[c4d69e2] | 3 | * |
[c18e0ba] | 4 | * @brief RTEMS Resume Task |
5 | * @ingroup ClassicTasks | |
6 | */ | |
7 | ||
8 | /* | |
[3a638ce] | 9 | * COPYRIGHT (c) 1989-2014. |
[c4d69e2] | 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 | |
[c499856] | 14 | * http://www.rtems.org/license/LICENSE. |
[c4d69e2] | 15 | */ |
16 | ||
[1095ec1] | 17 | #if HAVE_CONFIG_H |
18 | #include "config.h" | |
19 | #endif | |
20 | ||
[c404828] | 21 | #include <rtems/rtems/tasksimpl.h> |
[5618c37a] | 22 | #include <rtems/score/threadimpl.h> |
[c4d69e2] | 23 | |
24 | rtems_status_code rtems_task_resume( | |
[d3b72ca3] | 25 | rtems_id id |
[c4d69e2] | 26 | ) |
27 | { | |
[4d76300a] | 28 | Thread_Control *the_thread; |
29 | ISR_lock_Context lock_context; | |
30 | Per_CPU_Control *cpu_self; | |
31 | States_Control previous_state; | |
[c4d69e2] | 32 | |
[e266d13] | 33 | the_thread = _Thread_Get( id, &lock_context ); |
[ebe61382] | 34 | |
[4d76300a] | 35 | if ( the_thread == NULL ) { |
[c4d69e2] | 36 | #if defined(RTEMS_MULTIPROCESSING) |
[4d76300a] | 37 | return _RTEMS_tasks_MP_Resume( id ); |
38 | #else | |
39 | return RTEMS_INVALID_ID; | |
[c4d69e2] | 40 | #endif |
41 | } | |
42 | ||
[4d76300a] | 43 | cpu_self = _Thread_Dispatch_disable_critical( &lock_context ); |
44 | _ISR_lock_ISR_enable( &lock_context ); | |
45 | ||
46 | previous_state = _Thread_Clear_state( the_thread, STATES_SUSPENDED ); | |
47 | ||
48 | _Thread_Dispatch_enable( cpu_self ); | |
49 | return _States_Is_suspended( previous_state ) ? | |
50 | RTEMS_SUCCESSFUL : RTEMS_INCORRECT_STATE; | |
[c4d69e2] | 51 | } |
Note: See TracBrowser
for help on using the repository browser.