From 2979c288bb9433141d0ecca9f1ff0ed13b82e3df Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 12 Nov 1999 21:21:09 +0000 Subject: + Changed validation of the_thread to validation of location. + Removed error path that should never happen. --- c/src/exec/itron/src/sta_tsk.c | 22 +++++++++++----------- cpukit/itron/src/sta_tsk.c | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/c/src/exec/itron/src/sta_tsk.c b/c/src/exec/itron/src/sta_tsk.c index 73cc49e36b..83592edf9a 100644 --- a/c/src/exec/itron/src/sta_tsk.c +++ b/c/src/exec/itron/src/sta_tsk.c @@ -31,18 +31,16 @@ ER sta_tsk( boolean status; the_thread = _ITRON_Task_Get( tskid, &location ); - if (!the_thread) - _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); - - if ( !_States_Is_dormant( the_thread->current_state ) ) - _ITRON_return_errorno( E_OBJ ); - switch ( location ) { case OBJECTS_REMOTE: case OBJECTS_ERROR: _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); case OBJECTS_LOCAL: + + if ( !_States_Is_dormant( the_thread->current_state ) ) + _ITRON_return_errorno( E_OBJ ); + status = _Thread_Start( the_thread, THREAD_START_NUMERIC, /* XXX should be able to say we have no arg */ @@ -51,14 +49,16 @@ ER sta_tsk( 0 /* unused */ ); - if ( !status ) - _ITRON_return_errorno( E_OBJ ); + /* + * This error can not happen entry_point is checked in create. + if ( !status ) + _ITRON_return_errorno( E_OBJ ); + */ - _Thread_Enable_dispatch(); - return E_OK; + _ITRON_return_errorno( E_OK ); } - return E_OBJ; /* unreached - only to remove warnings */ + _ITRON_return_errorno( E_OBJ ); /* unreached - only to remove warnings */ } diff --git a/cpukit/itron/src/sta_tsk.c b/cpukit/itron/src/sta_tsk.c index 73cc49e36b..83592edf9a 100644 --- a/cpukit/itron/src/sta_tsk.c +++ b/cpukit/itron/src/sta_tsk.c @@ -31,18 +31,16 @@ ER sta_tsk( boolean status; the_thread = _ITRON_Task_Get( tskid, &location ); - if (!the_thread) - _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); - - if ( !_States_Is_dormant( the_thread->current_state ) ) - _ITRON_return_errorno( E_OBJ ); - switch ( location ) { case OBJECTS_REMOTE: case OBJECTS_ERROR: _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) ); case OBJECTS_LOCAL: + + if ( !_States_Is_dormant( the_thread->current_state ) ) + _ITRON_return_errorno( E_OBJ ); + status = _Thread_Start( the_thread, THREAD_START_NUMERIC, /* XXX should be able to say we have no arg */ @@ -51,14 +49,16 @@ ER sta_tsk( 0 /* unused */ ); - if ( !status ) - _ITRON_return_errorno( E_OBJ ); + /* + * This error can not happen entry_point is checked in create. + if ( !status ) + _ITRON_return_errorno( E_OBJ ); + */ - _Thread_Enable_dispatch(); - return E_OK; + _ITRON_return_errorno( E_OK ); } - return E_OBJ; /* unreached - only to remove warnings */ + _ITRON_return_errorno( E_OBJ ); /* unreached - only to remove warnings */ } -- cgit v1.2.3