RTEMS
cpukit
rtems
src
taskissuspended.c
Go to the documentation of this file.
1
9
/*
10
* COPYRIGHT (c) 1989-2014.
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
#ifdef HAVE_CONFIG_H
19
#include "config.h"
20
#endif
21
22
#include <
rtems/rtems/tasks.h
>
23
#include <
rtems/score/threadimpl.h
>
24
25
rtems_status_code
rtems_task_is_suspended
(
rtems_id
id
)
26
{
27
Thread_Control
*the_thread;
28
ISR_lock_Context
lock_context;
29
States_Control
current_state;
30
31
the_thread =
_Thread_Get
(
id
, &lock_context );
32
33
if
( the_thread == NULL ) {
34
#if defined(RTEMS_MULTIPROCESSING)
35
if
( _Thread_MP_Is_remote(
id
) ) {
36
return
RTEMS_ILLEGAL_ON_REMOTE_OBJECT
;
37
}
38
#endif
39
40
return
RTEMS_INVALID_ID
;
41
}
42
43
current_state = the_thread->
current_state
;
44
_ISR_lock_ISR_enable
( &lock_context);
45
return
_States_Is_suspended
( current_state ) ?
46
RTEMS_ALREADY_SUSPENDED
:
RTEMS_SUCCESSFUL
;
47
}
rtems_task_is_suspended
rtems_status_code rtems_task_is_suspended(rtems_id id)
%
Definition:
taskissuspended.c:25
RTEMS_ALREADY_SUSPENDED
This status code indicates that the thread was already suspended.
Definition:
status.h:165
_ISR_lock_ISR_enable
#define _ISR_lock_ISR_enable(_context)
Restores the saved interrupt state of the ISR lock context.
Definition:
isrlock.h:416
_Thread_Get
Thread_Control * _Thread_Get(Objects_Id id, ISR_lock_Context *lock_context)
Gets a thread by its identifier.
Definition:
threadget.c:24
States_Control
uint32_t States_Control
Definition:
states.h:46
RTEMS_SUCCESSFUL
This status code indicates successful completion.
Definition:
status.h:86
_Thread_Control
Definition:
thread.h:725
rtems_status_code
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition:
status.h:82
tasks.h
This header file defines the main parts of the Tasks Manager API.
_Thread_Control::current_state
States_Control current_state
Definition:
thread.h:749
_States_Is_suspended
static __inline__ bool _States_Is_suspended(States_Control the_states)
Checks if SUSPENDED state is set.
Definition:
statesimpl.h:231
RTEMS_INVALID_ID
This status code indicates that an object identifier was invalid.
Definition:
status.h:106
rtems_id
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition:
types.h:99
RTEMS_ILLEGAL_ON_REMOTE_OBJECT
This status code indicates that the operation was illegal on a remote object.
Definition:
status.h:177
threadimpl.h
Inlined Routines from the Thread Handler.
ISR_lock_Context
Local ISR lock context for acquire and release pairs.
Definition:
isrlock.h:65
Generated by
1.8.14