From 8a8f5b263ae4a42b85a2d0c4a598b9702e04a57e Mon Sep 17 00:00:00 2001 From: Glenn Humphrey Date: Tue, 6 Nov 2007 19:52:36 +0000 Subject: 2007-11-06 Glenn Humphrey Miscellaneous changes made after a review against the POSIX spec. * posix/src/pbarrierinit.c, posix/src/prwlockinit.c: If the caller passes a NULL in the attributes parameter, default attributes are used. * posix/src/prwlockdestroy.c: If there is at least one thread waiting, do not allow deletion. * posix/src/prwlockwrlock.c: Corrected parameter passed to the core operation used to obtain a RWLock for writing. * posix/src/pspinlocktranslatereturncode.c, score/include/rtems/score/corespinlock.h, score/src/corespinlockrelease.c: If the current thread is not the holder of the lock, do not allow an unlock and return EPERM. * score/src/corerwlockobtainwrite.c: Corrected to use the operation for queueing with a timeout handler. --- cpukit/posix/src/prwlockdestroy.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cpukit/posix/src/prwlockdestroy.c') diff --git a/cpukit/posix/src/prwlockdestroy.c b/cpukit/posix/src/prwlockdestroy.c index 67dac7571a..dc81393d8d 100644 --- a/cpukit/posix/src/prwlockdestroy.c +++ b/cpukit/posix/src/prwlockdestroy.c @@ -56,12 +56,17 @@ int pthread_rwlock_destroy( return EINVAL; case OBJECTS_LOCAL: -#if 0 - if ( the_rwlock->RWLock.number_of_waiting_threads != 0 ) { + /* + * If there is at least one thread waiting, then do not delete it. + */ + if ( _Thread_queue_First( &the_rwlock->RWLock.Wait_queue ) != NULL ) { _Thread_Enable_dispatch(); return EBUSY; } -#endif + + /* + * POSIX doesn't require behavior when it is locked. + */ _Objects_Close( &_POSIX_RWLock_Information, &the_rwlock->Object ); -- cgit v1.2.3