Changeset 36272279 in rtems


Ignore:
Timestamp:
Apr 8, 2016, 2:23:22 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
0a97ba5b
Parents:
8f6c295b
git-author:
Sebastian Huber <sebastian.huber@…> (04/08/16 14:23:22)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/18/16 06:20:12)
Message:

sapi: Avoid Giant lock for extensions

Extension create and delete is protected by the object allocator lock.

Update #2555.

Location:
cpukit/sapi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/rtems/extensionimpl.h

    r8f6c295b r36272279  
    4040}
    4141
    42 RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get (
    43   Objects_Id         id,
    44   Objects_Locations *location
    45 )
     42RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get( Objects_Id id )
    4643{
    4744  return (Extension_Control *)
    48     _Objects_Get( &_Extension_Information, id, location );
     45    _Objects_Get_no_protection( &_Extension_Information, id );
    4946}
    5047
  • cpukit/sapi/src/extensiondelete.c

    r8f6c295b r36272279  
    2121
    2222#include <rtems/extensionimpl.h>
    23 #include <rtems/score/thread.h>
    2423#include <rtems/score/userextimpl.h>
    2524
     
    2827)
    2928{
    30   Extension_Control   *the_extension;
    31   Objects_Locations    location;
     29  rtems_status_code  status;
     30  Extension_Control *the_extension;
    3231
    3332  _Objects_Allocator_lock();
    34   the_extension = _Extension_Get( id, &location );
    35   switch ( location ) {
    36     case OBJECTS_LOCAL:
    37       _User_extensions_Remove_set( &the_extension->Extension );
    38       _Objects_Close( &_Extension_Information, &the_extension->Object );
    39       _Objects_Put( &the_extension->Object );
    40       _Extension_Free( the_extension );
    41       _Objects_Allocator_unlock();
    42       return RTEMS_SUCCESSFUL;
    4333
    44 #if defined(RTEMS_MULTIPROCESSING)
    45     case OBJECTS_REMOTE:            /* should never return this */
    46 #endif
    47     case OBJECTS_ERROR:
    48       break;
     34  the_extension = _Extension_Get( id );
     35
     36  if ( the_extension != NULL ) {
     37    _Objects_Close( &_Extension_Information, &the_extension->Object );
     38    _User_extensions_Remove_set( &the_extension->Extension );
     39    _Extension_Free( the_extension );
     40    status = RTEMS_SUCCESSFUL;
     41  } else {
     42    status = RTEMS_INVALID_ID;
    4943  }
    5044
    5145  _Objects_Allocator_unlock();
    52 
    53   return RTEMS_INVALID_ID;
     46  return status;
    5447}
Note: See TracChangeset for help on using the changeset viewer.