This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Patch to mutex.c
- To: libc-alpha at sources dot redhat dot com
- Subject: Re: Patch to mutex.c
- From: Neale dot Ferguson at softwareAG-usa dot com
- Date: Wed, 27 Sep 2000 11:59:54 +0200
Sorry about raising this again, but does the comment below mean this patch will
be included? I've included it on my system and running some POSIX conformance
tests which it is now passing.
--- mutex.c 2000/09/20 14:35:30 1.1
+++ mutex.c 2000/09/21 17:46:11
@@ -165,15 +165,20 @@
case PTHREAD_MUTEX_RECURSIVE_NP:
if (mutex->__m_count > 0) {
mutex->__m_count--;
return 0;
}
- mutex->__m_owner = NULL;
- __pthread_unlock(&mutex->__m_lock);
- return 0;
+ if (mutex->__m_owner != NULL) {
+ mutex->__m_owner = NULL;
+ __pthread_unlock(&mutex->__m_lock);
+ return 0;
+ }
+ else
+ return EPERM;
+
> Further to the behavior of RECURSIVE mutexes. The man file does indicate the
> unpredictable nature of unlocking and non-locked mutex. I noted several
> exchanges on this list on the subject of man pages versus the standard.
>> By golly, you are right! The Single UNIX Specification does, in fact, require
>> recursive mutexes to have error checking properties. This needs to be fixed.