Changeset 51f823c9 in rtems for cpukit/sapi


Ignore:
Timestamp:
Mar 18, 2014, 7:28:14 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
ff25926
Parents:
fa3993d9
git-author:
Sebastian Huber <sebastian.huber@…> (03/18/14 07:28:14)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/19/14 07:34:26)
Message:

posix: Use interal mutex for once implementation

Enable pthread_once() for all configurations. The pthread_once()
function is one means to initialize POSIX keys. Another use case is the
C++ support.

Location:
cpukit/sapi
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/confdefs.h

    rfa3993d9 r51f823c9  
    17671767
    17681768  /**
    1769    * POSIX Once support uses a single mutex.
    1770    */
    1771   #define CONFIGURE_MAXIMUM_POSIX_INTERNAL_MUTEXES 1
    1772 
    1773   /**
    17741769   * Account for the object control structures plus the name
    17751770   * of the object to be duplicated.
     
    19001895  #define CONFIGURE_MEMORY_FOR_POSIX \
    19011896    ( CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES + \
    1902           CONFIGURE_MAXIMUM_POSIX_INTERNAL_MUTEXES + \
    19031897          CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES) + \
    19041898      CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
     
    21312125
    21322126/**
    2133  * RTEMS uses one instance of an internal mutex class.  This accounts
    2134  * for that mutex
     2127 * RTEMS uses two instance of an internal mutex class.  This accounts
     2128 * for these mutexes.
    21352129 */
    21362130#define CONFIGURE_API_MUTEX_MEMORY \
    2137   _Configure_Object_RAM(1, sizeof(API_Mutex_Control))
     2131  _Configure_Object_RAM(2, sizeof(API_Mutex_Control))
    21382132
    21392133/**
     
    23502344        CONFIGURE_MAXIMUM_GOROUTINES,
    23512345      CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES +
    2352         CONFIGURE_MAXIMUM_POSIX_INTERNAL_MUTEXES +
    23532346        CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS +
    23542347        CONFIGURE_GO_INIT_MUTEXES + CONFIGURE_MAXIMUM_GO_CHANNELS,
     
    26002593    /* POSIX API Pieces */
    26012594    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES +
    2602       CONFIGURE_MAXIMUM_POSIX_INTERNAL_MUTEXES +
    26032595      CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES),
    26042596    CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(
  • cpukit/sapi/src/exinit.c

    rfa3993d9 r51f823c9  
    117117  _Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects;
    118118
    119   _API_Mutex_Initialization( 1 );
     119  _API_Mutex_Initialization( 2 );
    120120  _API_Mutex_Allocate( &_RTEMS_Allocator_Mutex );
     121  _API_Mutex_Allocate( &_Once_Mutex );
    121122
    122123  _Watchdog_Handler_initialization();
  • cpukit/sapi/src/posixapi.c

    rfa3993d9 r51f823c9  
    3737#include <rtems/posix/mqueueimpl.h>
    3838#include <rtems/posix/muteximpl.h>
    39 #include <rtems/posix/onceimpl.h>
    4039#include <rtems/posix/priorityimpl.h>
    4140#include <rtems/posix/psignalimpl.h>
     
    8079    _POSIX_Mutex_Manager_initialization();
    8180    _POSIX_Message_queue_Manager_initialization();
    82     _POSIX_Once_Manager_initialization();
    8381    _POSIX_Semaphore_Manager_initialization();
    8482    _POSIX_Timer_Manager_initialization();
Note: See TracChangeset for help on using the changeset viewer.