From 23fec9f0e18dc4913fab818118f836af150b98f3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 27 Mar 2014 14:16:12 +0100 Subject: 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. --- cpukit/posix/src/prwlockdestroy.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cpukit/posix/src/prwlockdestroy.c') 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; } -- cgit v1.2.3