diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-25 08:37:28 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-25 12:48:00 +0200 |
commit | 3f72dda6ee518d3ea04341ad4df079ecb1895ef7 (patch) | |
tree | a52af043ef1665ed4f23d404ee447eba449143ff /cpukit/score/src/corespinlockrelease.c | |
parent | fat: Fix for invalid cluster sizes (diff) | |
download | rtems-3f72dda6ee518d3ea04341ad4df079ecb1895ef7.tar.bz2 |
posix: Fix pthread_spin_unlock() error status
Update #2719.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/corespinlockrelease.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/cpukit/score/src/corespinlockrelease.c b/cpukit/score/src/corespinlockrelease.c index c10337a123..c0abcc109f 100644 --- a/cpukit/score/src/corespinlockrelease.c +++ b/cpukit/score/src/corespinlockrelease.c @@ -32,17 +32,12 @@ CORE_spinlock_Status _CORE_spinlock_Release( _ISR_Disable( level ); /* - * It must locked before it can be unlocked. - */ - if ( the_spinlock->lock == CORE_SPINLOCK_UNLOCKED ) { - _ISR_Enable( level ); - return CORE_SPINLOCK_NOT_LOCKED; - } - - /* * It must locked by the current thread before it can be unlocked. */ - if ( the_spinlock->holder != _Thread_Executing->Object.id ) { + if ( + the_spinlock->lock != CORE_SPINLOCK_LOCKED + || the_spinlock->holder != _Thread_Executing + ) { _ISR_Enable( level ); return CORE_SPINLOCK_NOT_HOLDER; } |