source: rtems/c/src/exec/itron/src/rsm_tsk.c @ 5e77d129

4.104.114.84.95
Last change on this file since 5e77d129 was 9d9a3dd, checked in by Jennifer Averett <Jennifer.Averett@…>, on 11/17/99 at 16:47:58

+ Updated copyright information.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-1999.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.OARcorp.com/rtems/license.html.
8 *
9 *  $Id$
10 */
11
12#include <itron.h>
13
14#include <rtems/score/thread.h>
15#include <rtems/score/userext.h>
16#include <rtems/score/wkspace.h>
17#include <rtems/score/apiext.h>
18#include <rtems/score/sysstate.h>
19
20#include <rtems/itron/task.h>
21
22
23/*
24 *  rsm_tsk - Resume Suspended Task
25 */
26
27ER rsm_tsk(
28  ID tskid
29)
30{
31  register Thread_Control *the_thread;
32  Objects_Locations        location;
33
34  the_thread = _ITRON_Task_Get( tskid, &location );
35  switch ( location ) {
36    case OBJECTS_REMOTE:
37    case OBJECTS_ERROR:
38      return _ITRON_Task_Clarify_get_id_error( tskid );
39
40    case OBJECTS_LOCAL:
41
42      if ( _Thread_Is_executing( the_thread ) )
43        _ITRON_return_errorno( E_OBJ );
44
45      if ( _States_Is_dormant( the_thread->current_state ))
46        _ITRON_return_errorno( E_OBJ );
47
48      if ( ! _States_Is_suspended(the_thread->current_state) )
49        _ITRON_return_errorno( E_OK );
50
51      _Thread_Resume( the_thread, FALSE );
52      break;
53  }
54
55  _ITRON_return_errorno( E_OK );
56}
57
Note: See TracBrowser for help on using the repository browser.