source: rtems/cpukit/itron/src/sus_tsk.c @ d8f3f65b

4.104.114.84.95
Last change on this file since d8f3f65b was d8f3f65b, checked in by Joel Sherrill <joel.sherrill@…>, on 11/12/99 at 21:23:34

+ Changed validation of the_thread to validation of location.
+ Modified correct return path to call _ITRON_return_errorno( E_OK ) instead

of enabling dispatching and returning E_OK.

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