public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] default to normal pthread mutexes
Date: Mon, 14 Jul 2014 09:45:00 -0000	[thread overview]
Message-ID: <20140714094533.GA29162@calimero.vinschen.de> (raw)
In-Reply-To: <53C31871.9020900@cygwin.com>

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

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 #2: Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2014-07-14  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-13 23:38 Yaakov Selkowitz
2014-07-14  9:45 ` Corinna Vinschen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140714094533.GA29162@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).