diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-03-18 14:03:01 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-03-18 15:36:58 +0100 |
commit | 5a5fb3b9d6d99d6751d129458217f1a3b5b85ff8 (patch) | |
tree | 9f2296b7e4abaa0da454caea84e2fcbc0eb49fd2 /cpukit/posix/include | |
parent | score: Add _Objects_Get_by_name() (diff) | |
download | rtems-5a5fb3b9d6d99d6751d129458217f1a3b5b85ff8.tar.bz2 |
score: Avoid Giant lock for CORE spinlock
Use an ISR lock to protect the spinlock state. Remove empty attributes.
Update #2555.
Diffstat (limited to 'cpukit/posix/include')
-rw-r--r-- | cpukit/posix/include/rtems/posix/spinlockimpl.h | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/cpukit/posix/include/rtems/posix/spinlockimpl.h b/cpukit/posix/include/rtems/posix/spinlockimpl.h index 01fe372aca..0904050288 100644 --- a/cpukit/posix/include/rtems/posix/spinlockimpl.h +++ b/cpukit/posix/include/rtems/posix/spinlockimpl.h @@ -75,26 +75,19 @@ RTEMS_INLINE_ROUTINE void _POSIX_Spinlock_Free ( _Objects_Free( &_POSIX_Spinlock_Information, &the_spinlock->Object ); } -/** - * @brief Get a spinlock control block. - * - * This function maps spinlock IDs to spinlock control blocks. - * If ID corresponds to a local spinlock, then it returns - * the_spinlock control pointer which maps to ID and location - * is set to OBJECTS_LOCAL. if the spinlock ID is global and - * resides on a remote node, then location is set to OBJECTS_REMOTE, - * and the_spinlock is undefined. Otherwise, location is set - * to OBJECTS_ERROR and the_spinlock is undefined. - */ -RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Get ( +RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Get( pthread_spinlock_t *spinlock, - Objects_Locations *location + ISR_lock_Context *lock_context ) { - return (POSIX_Spinlock_Control *) _Objects_Get( - &_POSIX_Spinlock_Information, - (Objects_Id) *spinlock, - location + if ( spinlock == NULL ) { + return NULL; + } + + return (POSIX_Spinlock_Control *) _Objects_Get_local( + &_POSIX_Spinlock_Information, + *spinlock, + lock_context ); } |