summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-18 08:28:14 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-19 08:34:26 +0100
commit51f823c9327e3e73fb75688aaeeefae35007f37c (patch)
tree40798813bed67cc4fe27f7e570834fea9aa76276 /cpukit/sapi
parentscore: Make _ISR_Enable_without_giant() available (diff)
downloadrtems-51f823c9327e3e73fb75688aaeeefae35007f37c.tar.bz2
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.
Diffstat (limited to 'cpukit/sapi')
-rw-r--r--cpukit/sapi/include/confdefs.h14
-rw-r--r--cpukit/sapi/src/exinit.c3
-rw-r--r--cpukit/sapi/src/posixapi.c2
3 files changed, 5 insertions, 14 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index 08b8b5f4d7..add58aee17 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -1766,11 +1766,6 @@ const rtems_libio_helper rtems_fs_init_helper =
#include <rtems/posix/timer.h>
/**
- * POSIX Once support uses a single mutex.
- */
- #define CONFIGURE_MAXIMUM_POSIX_INTERNAL_MUTEXES 1
-
- /**
* Account for the object control structures plus the name
* of the object to be duplicated.
*/
@@ -1899,7 +1894,6 @@ const rtems_libio_helper rtems_fs_init_helper =
#define CONFIGURE_MEMORY_FOR_POSIX \
( CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES + \
- CONFIGURE_MAXIMUM_POSIX_INTERNAL_MUTEXES + \
CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES) + \
CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + \
@@ -2130,11 +2124,11 @@ const rtems_libio_helper rtems_fs_init_helper =
#endif
/**
- * RTEMS uses one instance of an internal mutex class. This accounts
- * for that mutex
+ * RTEMS uses two instance of an internal mutex class. This accounts
+ * for these mutexes.
*/
#define CONFIGURE_API_MUTEX_MEMORY \
- _Configure_Object_RAM(1, sizeof(API_Mutex_Control))
+ _Configure_Object_RAM(2, sizeof(API_Mutex_Control))
/**
* This calculates the amount of memory reserved for the IDLE tasks.
@@ -2349,7 +2343,6 @@ const rtems_libio_helper rtems_fs_init_helper =
CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS +
CONFIGURE_MAXIMUM_GOROUTINES,
CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES +
- CONFIGURE_MAXIMUM_POSIX_INTERNAL_MUTEXES +
CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS +
CONFIGURE_GO_INIT_MUTEXES + CONFIGURE_MAXIMUM_GO_CHANNELS,
CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
@@ -2599,7 +2592,6 @@ const rtems_libio_helper rtems_fs_init_helper =
#ifdef RTEMS_POSIX_API
/* POSIX API Pieces */
CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES +
- CONFIGURE_MAXIMUM_POSIX_INTERNAL_MUTEXES +
CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES),
CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(
CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c
index 077a092b0e..cc929cb4f3 100644
--- a/cpukit/sapi/src/exinit.c
+++ b/cpukit/sapi/src/exinit.c
@@ -116,8 +116,9 @@ void rtems_initialize_data_structures(void)
*/
_Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects;
- _API_Mutex_Initialization( 1 );
+ _API_Mutex_Initialization( 2 );
_API_Mutex_Allocate( &_RTEMS_Allocator_Mutex );
+ _API_Mutex_Allocate( &_Once_Mutex );
_Watchdog_Handler_initialization();
_TOD_Handler_initialization();
diff --git a/cpukit/sapi/src/posixapi.c b/cpukit/sapi/src/posixapi.c
index de502ec88d..502c3135ab 100644
--- a/cpukit/sapi/src/posixapi.c
+++ b/cpukit/sapi/src/posixapi.c
@@ -36,7 +36,6 @@
#include <rtems/posix/condimpl.h>
#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/muteximpl.h>
-#include <rtems/posix/onceimpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/psignalimpl.h>
#include <rtems/posix/pthreadimpl.h>
@@ -79,7 +78,6 @@ void _POSIX_API_Initialize(void)
_POSIX_Condition_variables_Manager_initialization();
_POSIX_Mutex_Manager_initialization();
_POSIX_Message_queue_Manager_initialization();
- _POSIX_Once_Manager_initialization();
_POSIX_Semaphore_Manager_initialization();
_POSIX_Timer_Manager_initialization();
_POSIX_Barrier_Manager_initialization();