source:
rtems/cpukit/itron/src/sus_tsk.c
@
a29d2e7
Last change on this file since a29d2e7 was 7ded4e37, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/15/04 at 04:00:25 | |
---|---|
|
|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[352c9b2] | 1 | /* |
[9d9a3dd] | 2 | * COPYRIGHT (c) 1989-1999. |
3 | * On-Line Applications Research Corporation (OAR). | |
4 | * | |
[352c9b2] | 5 | * The license and distribution terms for this file may be |
6 | * found in the file LICENSE in this distribution or at | |
[e49f9e6b] | 7 | * http://www.rtems.com/license/LICENSE. |
[352c9b2] | 8 | * |
9 | * $Id$ | |
10 | */ | |
11 | ||
[f42b726] | 12 | #if HAVE_CONFIG_H |
13 | #include "config.h" | |
14 | #endif | |
15 | ||
[0fa51b5b] | 16 | #include <limits.h> |
[ebbe119e] | 17 | #include <rtems/itron.h> |
[352c9b2] | 18 | |
19 | #include <rtems/score/thread.h> | |
20 | #include <rtems/score/userext.h> | |
21 | #include <rtems/score/wkspace.h> | |
22 | #include <rtems/score/apiext.h> | |
23 | #include <rtems/score/sysstate.h> | |
24 | ||
25 | #include <rtems/itron/task.h> | |
26 | ||
27 | ||
28 | /* | |
29 | * Task-Dependent Synchronization Functions | |
30 | */ | |
31 | ||
32 | /* | |
33 | * sus_tsk - Suspend Other Task | |
34 | */ | |
35 | ||
36 | ER sus_tsk( | |
37 | ID tskid | |
38 | ) | |
39 | { | |
[eb02f47] | 40 | register Thread_Control *the_thread; |
41 | Objects_Locations location; | |
42 | ||
43 | the_thread = _ITRON_Task_Get( tskid, &location ); | |
44 | switch ( location ) { | |
45 | case OBJECTS_REMOTE: | |
46 | case OBJECTS_ERROR: | |
[7ded4e37] | 47 | return _ITRON_Task_Clarify_get_id_error( tskid ); |
[eb02f47] | 48 | |
49 | case OBJECTS_LOCAL: | |
[d8f3f65b] | 50 | |
51 | if ( _Thread_Is_executing( the_thread ) ) | |
52 | _ITRON_return_errorno( E_OBJ ); | |
53 | ||
[0fa51b5b] | 54 | if (the_thread->suspend_count == INT_MAX ) |
55 | _ITRON_return_errorno( E_QOVR ); | |
56 | ||
[eb02f47] | 57 | _Thread_Suspend( the_thread ); |
[25789705] | 58 | break; |
[eb02f47] | 59 | } |
60 | ||
[7ded4e37] | 61 | _ITRON_return_errorno( E_OK ); |
[352c9b2] | 62 | } |
Note: See TracBrowser
for help on using the repository browser.