Changeset d8f3f65b in rtems


Ignore:
Timestamp:
Nov 12, 1999, 9:23:34 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
8ed3125d
Parents:
2979c28
Message:

+ Changed validation of the_thread to validation of location.
+ Modified correct return path to call _ITRON_return_errorno( E_OK ) instead

of enabling dispatching and returning E_OK.

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/itron/src/del_tsk.c

    r2979c28 rd8f3f65b  
    3131
    3232  the_thread = _ITRON_Task_Get( tskid, &location );
    33 
    34   if (!the_thread)
    35     _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
    36 
    37   if ( the_thread == _Thread_Executing )
    38     _ITRON_return_errorno( E_OBJ );
    39 
    40   if ( !_States_Is_dormant( the_thread->current_state ) )
    41     _ITRON_return_errorno( E_OBJ );
    42 
    4333  switch ( location ) {
    4434    case OBJECTS_REMOTE:
    4535    case OBJECTS_ERROR:
    4636      _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
     37      break;
    4738
    4839    case OBJECTS_LOCAL:
     40
     41      if ( _Thread_Is_executing( the_thread ) )
     42        _ITRON_return_errorno( E_OBJ );
     43
     44      if ( !_States_Is_dormant( the_thread->current_state ) )
     45        _ITRON_return_errorno( E_OBJ );
     46
    4947      result = _ITRON_Delete_task( the_thread );
     48      break;
    5049  }
    5150
    52   _Thread_Enable_dispatch();
    53   return E_OK;
     51  _ITRON_return_errorno( E_OK );
    5452}
    5553
  • c/src/exec/itron/src/frsm_tsk.c

    r2979c28 rd8f3f65b  
    3030
    3131  the_thread = _ITRON_Task_Get( tskid, &location );
    32   if (!the_thread)
    33     _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
    34 
    35   if ( the_thread == _Thread_Executing )
    36     _ITRON_return_errorno( E_OBJ );
    37 
    38   if (_States_Is_dormant( the_thread->current_state ))
    39     _ITRON_return_errorno( E_OBJ );
    40    
    4132  switch ( location ) {
    4233    case OBJECTS_REMOTE:
     
    4536
    4637    case OBJECTS_LOCAL:
     38      if ( _Thread_Is_executing( the_thread ) )
     39        _ITRON_return_errorno( E_OBJ );
     40
     41      if (_States_Is_dormant( the_thread->current_state ))
     42        _ITRON_return_errorno( E_OBJ );
     43   
    4744      _Thread_Resume( the_thread, TRUE );
    48       _Thread_Enable_dispatch();
    49       return E_OK;
     45      _ITRON_return_errorno( E_OK );
    5046  }
    5147
    52   return E_OBJ;          /* XXX - Should never get here */
     48  _ITRON_return_errorno( E_OBJ ); /* XXX - Should never get here */
    5349
    5450}
  • c/src/exec/itron/src/sus_tsk.c

    r2979c28 rd8f3f65b  
    3434
    3535  the_thread = _ITRON_Task_Get( tskid, &location );
    36   if (!the_thread)
    37     _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
    38 
    39   if ( the_thread == _Thread_Executing )
    40     _ITRON_return_errorno( E_OBJ );
    41 
    4236  switch ( location ) {
    4337    case OBJECTS_REMOTE:
     
    4640
    4741    case OBJECTS_LOCAL:
     42
     43      if ( _Thread_Is_executing( the_thread ) )
     44        _ITRON_return_errorno( E_OBJ );
     45
    4846      _Thread_Suspend( the_thread );
    49       _Thread_Enable_dispatch();
    50       return E_OK;
     47      _ITRON_return_errorno( E_OK );
    5148  }
    5249
    53   return E_OBJ;           /* XXX - Should never get here */
     50  _ITRON_return_errorno( E_OBJ );
    5451}
    5552
  • c/src/exec/itron/src/ter_tsk.c

    r2979c28 rd8f3f65b  
    3131  the_thread = _ITRON_Task_Get( tskid, &location );
    3232
    33   if ( !the_thread )
     33  if ( location != OBJECTS_LOCAL )
    3434    _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
    3535
    36   if ( the_thread == _Thread_Executing )
     36  if ( _Thread_Is_executing( the_thread ) )
    3737    _ITRON_return_errorno( E_OBJ );
    3838 
     
    4343  _Thread_Set_state( the_thread, STATES_DORMANT );
    4444
    45   _Thread_Enable_dispatch();
    46   return E_OK;
     45  _ITRON_return_errorno( E_OK );
    4746}
    4847
  • cpukit/itron/src/del_tsk.c

    r2979c28 rd8f3f65b  
    3131
    3232  the_thread = _ITRON_Task_Get( tskid, &location );
    33 
    34   if (!the_thread)
    35     _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
    36 
    37   if ( the_thread == _Thread_Executing )
    38     _ITRON_return_errorno( E_OBJ );
    39 
    40   if ( !_States_Is_dormant( the_thread->current_state ) )
    41     _ITRON_return_errorno( E_OBJ );
    42 
    4333  switch ( location ) {
    4434    case OBJECTS_REMOTE:
    4535    case OBJECTS_ERROR:
    4636      _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
     37      break;
    4738
    4839    case OBJECTS_LOCAL:
     40
     41      if ( _Thread_Is_executing( the_thread ) )
     42        _ITRON_return_errorno( E_OBJ );
     43
     44      if ( !_States_Is_dormant( the_thread->current_state ) )
     45        _ITRON_return_errorno( E_OBJ );
     46
    4947      result = _ITRON_Delete_task( the_thread );
     48      break;
    5049  }
    5150
    52   _Thread_Enable_dispatch();
    53   return E_OK;
     51  _ITRON_return_errorno( E_OK );
    5452}
    5553
  • cpukit/itron/src/frsm_tsk.c

    r2979c28 rd8f3f65b  
    3030
    3131  the_thread = _ITRON_Task_Get( tskid, &location );
    32   if (!the_thread)
    33     _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
    34 
    35   if ( the_thread == _Thread_Executing )
    36     _ITRON_return_errorno( E_OBJ );
    37 
    38   if (_States_Is_dormant( the_thread->current_state ))
    39     _ITRON_return_errorno( E_OBJ );
    40    
    4132  switch ( location ) {
    4233    case OBJECTS_REMOTE:
     
    4536
    4637    case OBJECTS_LOCAL:
     38      if ( _Thread_Is_executing( the_thread ) )
     39        _ITRON_return_errorno( E_OBJ );
     40
     41      if (_States_Is_dormant( the_thread->current_state ))
     42        _ITRON_return_errorno( E_OBJ );
     43   
    4744      _Thread_Resume( the_thread, TRUE );
    48       _Thread_Enable_dispatch();
    49       return E_OK;
     45      _ITRON_return_errorno( E_OK );
    5046  }
    5147
    52   return E_OBJ;          /* XXX - Should never get here */
     48  _ITRON_return_errorno( E_OBJ ); /* XXX - Should never get here */
    5349
    5450}
  • cpukit/itron/src/sus_tsk.c

    r2979c28 rd8f3f65b  
    3434
    3535  the_thread = _ITRON_Task_Get( tskid, &location );
    36   if (!the_thread)
    37     _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
    38 
    39   if ( the_thread == _Thread_Executing )
    40     _ITRON_return_errorno( E_OBJ );
    41 
    4236  switch ( location ) {
    4337    case OBJECTS_REMOTE:
     
    4640
    4741    case OBJECTS_LOCAL:
     42
     43      if ( _Thread_Is_executing( the_thread ) )
     44        _ITRON_return_errorno( E_OBJ );
     45
    4846      _Thread_Suspend( the_thread );
    49       _Thread_Enable_dispatch();
    50       return E_OK;
     47      _ITRON_return_errorno( E_OK );
    5148  }
    5249
    53   return E_OBJ;           /* XXX - Should never get here */
     50  _ITRON_return_errorno( E_OBJ );
    5451}
    5552
  • cpukit/itron/src/ter_tsk.c

    r2979c28 rd8f3f65b  
    3131  the_thread = _ITRON_Task_Get( tskid, &location );
    3232
    33   if ( !the_thread )
     33  if ( location != OBJECTS_LOCAL )
    3434    _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
    3535
    36   if ( the_thread == _Thread_Executing )
     36  if ( _Thread_Is_executing( the_thread ) )
    3737    _ITRON_return_errorno( E_OBJ );
    3838 
     
    4343  _Thread_Set_state( the_thread, STATES_DORMANT );
    4444
    45   _Thread_Enable_dispatch();
    46   return E_OK;
     45  _ITRON_return_errorno( E_OK );
    4746}
    4847
Note: See TracChangeset for help on using the changeset viewer.