delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/22/11:47:40

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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: <4fc195f205072208471d60b4e0@mail.gmail.com>
Date: Fri, 22 Jul 2005 11:47:05 -0400
From: Fred Smith <fred DOT fredex AT gmail DOT com>
Reply-To: Fred Smith <fred DOT fredex AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin Digest 22 Jul 2005 13:17:06 -0000 Issue 4401
In-Reply-To: <1122038226.24364.ezmlm@cygwin.com>
Mime-Version: 1.0
References: <1122038226 DOT 24364 DOT ezmlm AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j6MFldUs007691

> ---------- Forwarded message ----------
> From: "Dave Korn" <dave DOT korn AT artimi DOT com>
> To: <cygwin AT cygwin DOT com>
> Date: Fri, 22 Jul 2005 11:47:40 +0100
> Subject: RE: Known issues with Pthreads in 1.5.18?
> ----Original Message----
> >From: Fred Smith
> >Sent: 22 July 2005 01:03
> 
> > I can't determine yet if I've got a subtle bug (quite possible) or if
> > there's something whacko in cygwin. I'm hoping some of you can
> > enlighten me as to the state of cygwin's pthreads functions.
> >
> > The program has a particular mutex that fails the SECOND time it is
> > unlocked. I'm at home right now so I don't have the particular error
> > code.
> >
> > It acts like the stack is wedged, because if I put an extra variable
> > on the stack in the routine that calls the pthread unlock function the
> > problem goes away, but so far it has eluded me.
> >
> > I'll keep looking for it, but thought to inquire of any known issues
> > in the pthreads implementation.
> 
> 
>   The default type of mutex just got changed, from error checking, to
> normal.  If your code is setting up a default mutex and then one thread
> attempts to recursively take the mutex, it will now deadlock where before it
> would have succeeded.  Or it may be possible your code is unlocking the
> mutex more times than it takes it, which would probably show the same
> symptom.  See the thread starting at:
> 
> http://www.cygwin.com/ml/cygwin/2005-05/msg01298.html
> 
> and the announcment for 1.5.18
> 
> http://www.cygwin.com/ml/cygwin-announce/2005-07/msg00001.html
> 
> in particular the line that says
> 
> "cgf: Change default value for PTHREAD_MUTEX_DEFAULT to PTHREAD_NORMAL."
> 
> 
>     cheers,
>       DaveK

Thanks for the reply, Dave!

The error I'm getting back from pthread_mutex_unlock() is 1,
"operation not permitted". I suppose this would be a valid response to
attempting to unlock a mutex that isn't locked. I'm pretty sure the
code isn't calling the unlock an extra time (else I think I'd be
having trouble on other platforms) but I'll go take (yet) another look
into that possibility.

I'll also verify the initialization values I'm using, too.

thanks again!

Fred

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019