Changeset 23fec9f in rtems for cpukit/sapi


Ignore:
Timestamp:
Mar 27, 2014, 1:16:12 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
f0b4fd9
Parents:
34684573
git-author:
Sebastian Huber <sebastian.huber@…> (03/27/14 13:16:12)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/31/14 06:29:44)
Message:

score: PR2152: Use allocator mutex for objects

Use allocator mutex for objects allocate/free. This prevents that the
thread dispatch latency depends on the workspace/heap fragmentation.

Location:
cpukit/sapi/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/src/extensioncreate.c

    r34684573 r23fec9f  
    4040    return RTEMS_INVALID_NAME;
    4141
    42   _Thread_Disable_dispatch();         /* to prevent deletion */
    43 
    4442  the_extension = _Extension_Allocate();
    4543
    4644  if ( !the_extension ) {
    47     _Thread_Enable_dispatch();
     45    _Objects_Allocator_unlock();
    4846    return RTEMS_TOO_MANY;
    4947  }
    5048
     49  _Thread_Disable_dispatch();
    5150  _User_extensions_Add_set_with_table( &the_extension->Extension, extension_table );
     51  _Thread_Enable_dispatch();
    5252
    5353  _Objects_Open(
     
    5858
    5959  *id = the_extension->Object.id;
    60   _Thread_Enable_dispatch();
     60  _Objects_Allocator_unlock();
    6161  return RTEMS_SUCCESSFUL;
    6262}
  • cpukit/sapi/src/extensiondelete.c

    r34684573 r23fec9f  
    3131  Objects_Locations    location;
    3232
     33  _Objects_Allocator_lock();
    3334  the_extension = _Extension_Get( id, &location );
    3435  switch ( location ) {
     
    3637      _User_extensions_Remove_set( &the_extension->Extension );
    3738      _Objects_Close( &_Extension_Information, &the_extension->Object );
     39      _Objects_Put( &the_extension->Object );
    3840      _Extension_Free( the_extension );
    39       _Objects_Put( &the_extension->Object );
     41      _Objects_Allocator_unlock();
    4042      return RTEMS_SUCCESSFUL;
    4143
     
    4749  }
    4850
     51  _Objects_Allocator_unlock();
     52
    4953  return RTEMS_INVALID_ID;
    5054}
Note: See TracChangeset for help on using the changeset viewer.