diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-20 14:01:02 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-22 09:25:09 +0200 |
commit | f27383a518836881b7b9b88e88d2e31d5b23d048 (patch) | |
tree | ecdccfa9c902a5a8db0918026e8074af0b581a6a /cpukit/posix/include | |
parent | score: Add _Thread_queue_Flush_default_filter() (diff) | |
download | rtems-f27383a518836881b7b9b88e88d2e31d5b23d048.tar.bz2 |
score: Avoid Giant lock for barriers
Use _Thread_queue_Flush_critical() to atomically release the barrier.
Update #2555.
Diffstat (limited to 'cpukit/posix/include')
-rw-r--r-- | cpukit/posix/include/rtems/posix/barrierimpl.h | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/cpukit/posix/include/rtems/posix/barrierimpl.h b/cpukit/posix/include/rtems/posix/barrierimpl.h index 646b734da2..16ccdc5138 100644 --- a/cpukit/posix/include/rtems/posix/barrierimpl.h +++ b/cpukit/posix/include/rtems/posix/barrierimpl.h @@ -23,6 +23,7 @@ #include <rtems/score/corebarrierimpl.h> #include <rtems/score/objectimpl.h> +#include <errno.h> #include <pthread.h> #ifdef __cplusplus @@ -76,26 +77,15 @@ RTEMS_INLINE_ROUTINE void _POSIX_Barrier_Free ( _Objects_Free( &_POSIX_Barrier_Information, &the_barrier->Object ); } -/** - * @brief Get a barrier control block. - * - * This function maps barrier IDs to barrier control blocks. - * If ID corresponds to a local barrier, then it returns - * the_barrier control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. if the barrier ID is global and - * resides on a remote node, then location is set to OBJECTS_REMOTE, - * and the_barrier is undefined. Otherwise, location is set - * to OBJECTS_ERROR and the_barrier is undefined. - */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Get ( - pthread_barrier_t *barrier, - Objects_Locations *location + const pthread_barrier_t *barrier, + ISR_lock_Context *lock_context ) { - return (POSIX_Barrier_Control *) _Objects_Get( - &_POSIX_Barrier_Information, - (Objects_Id) *barrier, - location + return (POSIX_Barrier_Control *) _Objects_Get_local( + (Objects_Id) *barrier, + &_POSIX_Barrier_Information, + lock_context ); } |