Changeset cb1b853d in rtems


Ignore:
Timestamp:
Jun 18, 1998, 7:01:57 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
8ed1f8d0
Parents:
7e4c3d8b
Message:

All task delete API level services were incorrectly assuming that the
task to be deleted was created via the same API (i.e. were of the object
class created by this API). For example, a POSIX thread calling
the rtems_task_delete(SELF) directive would incorrectly update the RTEMS
object local pointer table.

Jennifer discovered this when moving tests implemented in C using the
Classic RTEMS API into a tree of Ada tests. The Ada tests were implicitly
using POSIX services. This lead to some unexpected behavior.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/posix/src/pthread.c

    r7e4c3d8b rcb1b853d  
    11451145)
    11461146{
     1147  Objects_Information     *the_information;
     1148
     1149  the_information = _Objects_Get_information( _Thread_Executing->Object.id );
     1150 
    11471151  _Thread_Disable_dispatch();
    11481152
    11491153  _Thread_Executing->Wait.return_argument = (unsigned32 *)value_ptr;
    11501154
    1151   _Thread_Close( &_POSIX_Threads_Information, _Thread_Executing );
     1155  _Thread_Close( the_information, _Thread_Executing );
    11521156
    11531157  _POSIX_Threads_Free( _Thread_Executing );
  • c/src/exec/rtems/src/tasks.c

    r7e4c3d8b rcb1b853d  
    556556  register Thread_Control *the_thread;
    557557  Objects_Locations        location;
     558  Objects_Information     *the_information;
    558559
    559560  the_thread = _Thread_Get( id, &location );
     
    565566      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    566567    case OBJECTS_LOCAL:
    567       _Thread_Close( &_RTEMS_tasks_Information, the_thread );
     568      the_information = _Objects_Get_information( the_thread->Object.id );
     569
     570      if ( !the_information ) {
     571        _Thread_Enable_dispatch();
     572        return RTEMS_INVALID_ID;
     573        /* This should never happen if _Thread_Get() works right */
     574      }
     575 
     576      _Thread_Close( the_information, the_thread );
    568577
    569578      _RTEMS_tasks_Free( the_thread );
  • cpukit/posix/src/pthread.c

    r7e4c3d8b rcb1b853d  
    11451145)
    11461146{
     1147  Objects_Information     *the_information;
     1148
     1149  the_information = _Objects_Get_information( _Thread_Executing->Object.id );
     1150 
    11471151  _Thread_Disable_dispatch();
    11481152
    11491153  _Thread_Executing->Wait.return_argument = (unsigned32 *)value_ptr;
    11501154
    1151   _Thread_Close( &_POSIX_Threads_Information, _Thread_Executing );
     1155  _Thread_Close( the_information, _Thread_Executing );
    11521156
    11531157  _POSIX_Threads_Free( _Thread_Executing );
  • cpukit/rtems/src/tasks.c

    r7e4c3d8b rcb1b853d  
    556556  register Thread_Control *the_thread;
    557557  Objects_Locations        location;
     558  Objects_Information     *the_information;
    558559
    559560  the_thread = _Thread_Get( id, &location );
     
    565566      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
    566567    case OBJECTS_LOCAL:
    567       _Thread_Close( &_RTEMS_tasks_Information, the_thread );
     568      the_information = _Objects_Get_information( the_thread->Object.id );
     569
     570      if ( !the_information ) {
     571        _Thread_Enable_dispatch();
     572        return RTEMS_INVALID_ID;
     573        /* This should never happen if _Thread_Get() works right */
     574      }
     575 
     576      _Thread_Close( the_information, the_thread );
    568577
    569578      _RTEMS_tasks_Free( the_thread );
Note: See TracChangeset for help on using the changeset viewer.