diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-19 17:02:54 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-22 09:25:08 +0200 |
commit | 4025a60fcb892169266102a58beef4caad17340c (patch) | |
tree | 004df492a31db98faa24335a663eed429ebb5d05 /cpukit/posix/src/semaphoredeletesupp.c | |
parent | posix: Avoid Giant lock in sem_getvalue() (diff) | |
download | rtems-4025a60fcb892169266102a58beef4caad17340c.tar.bz2 |
score: Avoid Giant lock for CORE mtx/sem
Avoid Giant lock for CORE mutex and semaphore flush and delete
operations.
Update #2555.
Diffstat (limited to 'cpukit/posix/src/semaphoredeletesupp.c')
-rw-r--r-- | cpukit/posix/src/semaphoredeletesupp.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/cpukit/posix/src/semaphoredeletesupp.c b/cpukit/posix/src/semaphoredeletesupp.c index 4394674699..7c23bb889d 100644 --- a/cpukit/posix/src/semaphoredeletesupp.c +++ b/cpukit/posix/src/semaphoredeletesupp.c @@ -18,25 +18,23 @@ #include "config.h" #endif -#include <stdarg.h> - -#include <errno.h> -#include <fcntl.h> -#include <pthread.h> -#include <semaphore.h> -#include <limits.h> - -#include <rtems/system.h> #include <rtems/posix/semaphoreimpl.h> -#include <rtems/seterr.h> void _POSIX_Semaphore_Delete( - POSIX_Semaphore_Control *the_semaphore + POSIX_Semaphore_Control *the_semaphore, + ISR_lock_Context *lock_context ) { if ( !the_semaphore->linked && !the_semaphore->open_count ) { _Objects_Close( &_POSIX_Semaphore_Information, &the_semaphore->Object ); - _CORE_semaphore_Destroy( &the_semaphore->Semaphore, NULL, 0 ); + _CORE_semaphore_Destroy( + &the_semaphore->Semaphore, + NULL, + 0, + lock_context + ); _POSIX_Semaphore_Free( the_semaphore ); + } else { + _CORE_semaphore_Release( &the_semaphore->Semaphore, lock_context ); } } |