forked from Imagelibrary/rtems
+ Changed validation of the_thread to validation of location.
This commit is contained in:
@@ -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:
|
||||
/*
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user