RTEMS
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 
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 ) ) {
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 ) ?
47 }
rtems_status_code rtems_task_is_suspended(rtems_id id)
%
This status code indicates that the thread was already suspended.
Definition: status.h:165
#define _ISR_lock_ISR_enable(_context)
Restores the saved interrupt state of the ISR lock context.
Definition: isrlock.h:416
Thread_Control * _Thread_Get(Objects_Id id, ISR_lock_Context *lock_context)
Gets a thread by its identifier.
Definition: threadget.c:24
uint32_t States_Control
Definition: states.h:46
This status code indicates successful completion.
Definition: status.h:86
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
This header file defines the main parts of the Tasks Manager API.
States_Control current_state
Definition: thread.h:749
static __inline__ bool _States_Is_suspended(States_Control the_states)
Checks if SUSPENDED state is set.
Definition: statesimpl.h:231
This status code indicates that an object identifier was invalid.
Definition: status.h:106
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99
This status code indicates that the operation was illegal on a remote object.
Definition: status.h:177
Inlined Routines from the Thread Handler.
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65