diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-27 14:16:12 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-31 08:29:44 +0200 |
commit | 23fec9f0e18dc4913fab818118f836af150b98f3 (patch) | |
tree | 66228f23bbf654117a33e28db7a017eea21fb785 /cpukit/posix/src/prwlockdestroy.c | |
parent | score: Use thread life protection for API mutexes (diff) | |
download | rtems-23fec9f0e18dc4913fab818118f836af150b98f3.tar.bz2 |
score: PR2152: Use allocator mutex for objects
Use allocator mutex for objects allocate/free. This prevents that the
thread dispatch latency depends on the workspace/heap fragmentation.
Diffstat (limited to '')
-rw-r--r-- | cpukit/posix/src/prwlockdestroy.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cpukit/posix/src/prwlockdestroy.c b/cpukit/posix/src/prwlockdestroy.c index 9054e921de..d1261ca4fb 100644 --- a/cpukit/posix/src/prwlockdestroy.c +++ b/cpukit/posix/src/prwlockdestroy.c @@ -44,6 +44,7 @@ int pthread_rwlock_destroy( if ( !rwlock ) return EINVAL; + _Objects_Allocator_lock(); the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { @@ -53,6 +54,7 @@ int pthread_rwlock_destroy( */ if ( _Thread_queue_First( &the_rwlock->RWLock.Wait_queue ) != NULL ) { _Objects_Put( &the_rwlock->Object ); + _Objects_Allocator_unlock(); return EBUSY; } @@ -61,10 +63,10 @@ int pthread_rwlock_destroy( */ _Objects_Close( &_POSIX_RWLock_Information, &the_rwlock->Object ); - + _Objects_Put( &the_rwlock->Object ); _POSIX_RWLock_Free( the_rwlock ); + _Objects_Allocator_unlock(); - _Objects_Put( &the_rwlock->Object ); return 0; #if defined(RTEMS_MULTIPROCESSING) @@ -74,5 +76,7 @@ int pthread_rwlock_destroy( break; } + _Objects_Allocator_unlock(); + return EINVAL; } |