This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] default to normal pthread mutexes


Hi Yaakov,

On Jul 13 18:38, Yaakov Selkowitz wrote:
> Defaulting to ERRORCHECK mutexes (with the various stringencies it implies)
> does not match the behaviour on Linux, where NORMAL mutexes are the default.
> I have been testing this locally for some time, and I believe it affects a
> lot of software.  Patch and STC attached.
> 
> 
> Yaakov

> 2014-07-13  Yaakov Selkowitz  <yselkowitz@...>
> 
> 	* thread.cc (pthread_mutex::pthread_mutex): Change default type
> 	to PTHREAD_MUTEX_NORMAL.
> 	(pthread_mutexattr::pthread_mutexattr): Ditto.
> 	(pthread_mutex_unlock): Do not fail if mutex is a normal mutex
> 	initializer.
> 	* include/pthread.h (PTHREAD_MUTEX_INITIALIZER): Redefine as
> 	PTHREAD_NORMAL_MUTEX_INITIALIZER_NP.

I checked this in with a small addition.  While testing I found that
Cygwin's pthread_mutex_unlock returned EINVAL if the mutex is of the
PTHREAD_MUTEX_ERRORCHECK type and the mutex wasn't owned by any thread
(as in your STC),  Linux returns EPERM in this case.  I fixed that.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpE9nSI8LPNr.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]