source: rtems/c/src/exec/itron/src/del_tsk.c @ f42b726

4.104.114.84.95
Last change on this file since f42b726 was f42b726, checked in by Joel Sherrill <joel.sherrill@…>, on 01/24/01 at 14:17:28

2001-01-24 Ralf Corsepius <corsepiu@…>

  • configure.in: Add src/config.h
  • src/Makefile.am: Add INCLUDES += -I. to pickup config.h
  • src/.cvsignore: Add config.h and stamp-h
  • src/*.c: Add config.h support.
  • 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#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <itron.h>
17
18#include <rtems/score/thread.h>
19#include <rtems/score/userext.h>
20#include <rtems/score/wkspace.h>
21#include <rtems/score/apiext.h>
22#include <rtems/score/sysstate.h>
23
24#include <rtems/itron/task.h>
25
26
27/*
28 *  del_tsk - Delete Task
29 */
30
31ER del_tsk(
32  ID tskid
33)
34{
35  register Thread_Control *the_thread;
36  Objects_Locations        location;
37  ER                       result = E_OK; /* to avoid warning */
38
39  the_thread = _ITRON_Task_Get( tskid, &location );
40  switch ( location ) {
41    case OBJECTS_REMOTE:
42    case OBJECTS_ERROR:
43      return _ITRON_Task_Clarify_get_id_error( tskid );
44
45    case OBJECTS_LOCAL:
46
47      if ( _Thread_Is_executing( the_thread ) )
48        _ITRON_return_errorno( E_OBJ );
49
50      if ( !_States_Is_dormant( the_thread->current_state ) )
51        _ITRON_return_errorno( E_OBJ );
52
53      result = _ITRON_Delete_task( the_thread );
54      break;
55  }
56
57  _ITRON_return_errorno( result );
58}
59
Note: See TracBrowser for help on using the repository browser.