public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Robert Collins" <robert.collins@itdomain.com.au>
To: "Michael Labhard" <ince@pacifier.com>, <cygwin@cygwin.com>
Subject: RE: pthread_cond_wait does not relock mutex on release
Date: Wed, 17 Apr 2002 01:45:00 -0000	[thread overview]
Message-ID: <FC169E059D1A0442A04C40F86D9BA7600C5E4E@itdomain003.itdomain.net.au> (raw)



> -----Original Message-----
> From: Michael Labhard [mailto:ince@pacifier.com] 
> Sent: Wednesday, April 17, 2002 5:01 AM
> To: cygwin@cygwin.com
> Subject: pthread_cond_wait does not relock mutex on release
> 
> 
> Don't no if anyone else has noticed this:  the 
> pthread_cond_wait when signalled does not lock the associated 
> mutex again.  

This is incorrect. It does lock the mutex again.:

(from __pthread_cond_dowait which implemented pthread_cond_wait)

  (*themutex)->Lock ();
  if (last == true)
    (*cond)->mutex = NULL;
  if (pthread_mutex_lock (&(*cond)->cond_access))
    system_printf ("Failed to lock condition variable access mutex, this
%p", *c
ond);
  InterlockedDecrement (&((*themutex)->condwaits));
  if (pthread_mutex_unlock (&(*cond)->cond_access))
    system_printf ("Failed to unlock condition variable access mutex,
this %p",
*cond);

  return rv;
}

Chances are your test app is buggy, or you are making one or more
assumptions about the mutex type (ie recursiveness etc) that are
incorrect.

Rob

--
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/

             reply	other threads:[~2002-04-17  7:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-17  1:45 Robert Collins [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-04-18  0:26 Robert Collins
2002-04-17 20:33 Michael Labhard
2002-04-18  6:35 ` Gerald S. Williams
2002-04-16 12:51 Michael Labhard
2002-04-17  7:10 ` Gerald S. Williams

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=FC169E059D1A0442A04C40F86D9BA7600C5E4E@itdomain003.itdomain.net.au \
    --to=robert.collins@itdomain.com.au \
    --cc=cygwin@cygwin.com \
    --cc=ince@pacifier.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).