+ Changed validation of the_thread to validation of location.

This commit is contained in:
Joel Sherrill
1999-11-12 21:20:04 +00:00
parent 037a7b16a1
commit 3971537bd2
4 changed files with 16 additions and 34 deletions

View File

@@ -28,16 +28,10 @@ ER rel_wai(
Objects_Locations location;
the_thread = _ITRON_Task_Get( tskid, &location );
if (!the_thread)
_ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
_Thread_Disable_dispatch();
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:
/*

View File

@@ -29,22 +29,19 @@ ER rsm_tsk(
Objects_Locations location;
the_thread = _ITRON_Task_Get( tskid, &location );
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:
_ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
case OBJECTS_LOCAL:
if ( _Thread_Is_executing( the_thread ) )
_ITRON_return_errorno( E_OBJ );
if ( _States_Is_dormant( the_thread->current_state ))
_ITRON_return_errorno( E_OBJ );
_Thread_Resume( the_thread, FALSE );
_Thread_Enable_dispatch();
return E_OK;