diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-10 13:48:27 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-10 13:48:27 +0000 |
commit | eb02f47b126b56091ffaeaad470a48e2ac6d57b5 (patch) | |
tree | d52c66ad2d1a1b60d4eecd873949aa07477f8b87 /cpukit/itron/src/del_tsk.c | |
parent | Added support for ITRON tests. (diff) | |
download | rtems-eb02f47b126b56091ffaeaad470a48e2ac6d57b5.tar.bz2 |
Committed modifications from ITRON Task and Task Dependendent Synchronization
Working Group. Included are tests.
Diffstat (limited to 'cpukit/itron/src/del_tsk.c')
-rw-r--r-- | cpukit/itron/src/del_tsk.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cpukit/itron/src/del_tsk.c b/cpukit/itron/src/del_tsk.c index 5230acddca..4514eb6348 100644 --- a/cpukit/itron/src/del_tsk.c +++ b/cpukit/itron/src/del_tsk.c @@ -29,16 +29,21 @@ ER del_tsk( Objects_Locations location; ER result; - /* XXX - Fix Documentation and error checking for this error on self */ - the_thread = _ITRON_Task_Get( tskid, &location ); - _Thread_Disable_dispatch(); + + if (!the_thread) + _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); + + if ( the_thread == _Thread_Executing ) + _ITRON_return_errorno( E_OBJ ); + + if ( !_States_Is_dormant( the_thread->current_state ) ) + _ITRON_return_errorno( E_OBJ ); switch ( location ) { case OBJECTS_REMOTE: case OBJECTS_ERROR: - _Thread_Enable_dispatch(); - return _ITRON_Task_Clarify_get_id_error( tskid ); + _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); case OBJECTS_LOCAL: result = _ITRON_Delete_task( the_thread ); |