diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-18 08:28:14 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-19 08:34:26 +0100 |
commit | 51f823c9327e3e73fb75688aaeeefae35007f37c (patch) | |
tree | 40798813bed67cc4fe27f7e570834fea9aa76276 /cpukit/score/include/rtems/score/apimutex.h | |
parent | score: Make _ISR_Enable_without_giant() available (diff) | |
download | rtems-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/score/include/rtems/score/apimutex.h')
-rw-r--r-- | cpukit/score/include/rtems/score/apimutex.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/apimutex.h b/cpukit/score/include/rtems/score/apimutex.h index a34270ec08..1178ccb765 100644 --- a/cpukit/score/include/rtems/score/apimutex.h +++ b/cpukit/score/include/rtems/score/apimutex.h @@ -120,6 +120,18 @@ SCORE_EXTERN API_Mutex_Control *_RTEMS_Allocator_Mutex; #define _RTEMS_Unlock_allocator() \ _API_Mutex_Unlock( _RTEMS_Allocator_Mutex ) +SCORE_EXTERN API_Mutex_Control *_Once_Mutex; + +static inline void _Once_Lock( void ) +{ + _API_Mutex_Lock( _Once_Mutex ); +} + +static inline void _Once_Unlock( void ) +{ + _API_Mutex_Unlock( _Once_Mutex ); +} + /** @} */ #ifdef __cplusplus |