source: rtems/cpukit/rtems/src/taskissuspended.c @ b2de426

5
Last change on this file since b2de426 was e266d13, checked in by Sebastian Huber <sebastian.huber@…>, on 05/20/16 at 13:10:27

Replace *_Get_interrupt_disable() with *_Get()

Uniformly use *_Get() to get an object by identifier with a lock
context.

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/**
2 * @file
3 *
4 * @brief rtems_task_is_suspended
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
24rtems_status_code rtems_task_is_suspended( rtems_id id )
25{
26  Thread_Control   *the_thread;
27  ISR_lock_Context  lock_context;
28  States_Control    current_state;
29
30  the_thread = _Thread_Get( id, &lock_context );
31
32  if ( the_thread == NULL ) {
33#if defined(RTEMS_MULTIPROCESSING)
34    if ( _Thread_MP_Is_remote( id ) ) {
35      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
36    }
37#endif
38
39    return RTEMS_INVALID_ID;
40  }
41
42  current_state = the_thread->current_state;
43  _ISR_lock_ISR_enable( &lock_context);
44  return _States_Is_suspended( current_state ) ?
45    RTEMS_ALREADY_SUSPENDED : RTEMS_SUCCESSFUL;
46}
Note: See TracBrowser for help on using the repository browser.