delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Message-ID: | <3DEE9416.8060605@earthlink.net> |
Date: | Wed, 04 Dec 2002 15:47:34 -0800 |
From: | Christophe Galerne <christophegalerne AT earthlink DOT net> |
User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826 |
X-Accept-Language: | en-us, en, fr-fr, fr |
MIME-Version: | 1.0 |
To: | Robert Collins <rbcollins AT cygwin DOT com> |
CC: | cygwin <cygwin AT cygwin DOT com> |
Subject: | Re: pthread_mutex_trylock does not lock |
References: | <3DEE74C3 DOT 1070208 AT earthlink DOT net> <1039074697 DOT 8812 DOT 24 DOT camel AT lifelesswks> |
Robert Collins wrote: > On Thu, 2002-12-05 at 08:33, Christophe Galerne wrote: > > NB: PT_MUTEX_NORMAL is not a posix mutex type - it's PTHREAD_MUTEX_NORMAL.... Right that was a typo. > Or you could check the return value from pthread_mutexattr_settype and > see that it returns EINVAL. The thing is it's not really an invalid value for 'type' in the call. Maybe it would be better to break the compilation of programs that expect this value rather than have the developpers debug their applications before figuring it out. Come to think about it, I'm wondering if there was a policy of having the headers right first then the implementation or if headers and imlpementation came together. But that's maybe not the right maillist for that. =:-D >>Also above >>pthread.h(57): #define PTHREAD_MUTEX_INITIALIZER (void *)20 >>a comment that says that a default MUTEX will be recursive >>might avoid some surprise. =:-D > > Look at pthread.h:53 and pthread.h:58. DEFAULT is mapped to RECURSIVE That's a good point. Onather solution that might be considered more elegant would be to rearrange the defines to make the default behavior self-explanatory. Ex. #define PTHREAD_MUTEX_RECURSIVE 0 #define PTHREAD_MUTEX_ERRORCHECK 1 #define PTHREAD_MUTEX_NORMAL 2 #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_RECURSIVE Christophe -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |