public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Peter Slacik <Peter.Slacik@tatramed.sk>
To: Ross Johnson <rpj@ise.canberra.edu.au>
Cc: Pthreads Developers List <pthreads-win32@sourceware.cygnus.com>
Subject: Re: Pthreads over Win32 / Condition Variables (fwd)
Date: Fri, 15 Oct 1999 05:25:00 -0000	[thread overview]
Message-ID: <38071BF8.1D42C185@TatraMed.sk> (raw)
In-Reply-To: <Pine.LNX.4.05.9910141750340.28647-100000@swan.canberra.edu.au>

Ross Johnson wrote:

> [...] looking at the code I've found another bug nearby.
>
> The internal routine Cond_timedwait, called by pthread_cond_wait and
> pthread_cond_timedwait, is a cancelation point. In case the thread
> is canceled while it's waiting, the code pushes a cleanup handler
> (actually just pthread_mutex_lock) to re-lock the mutex associated
> with the CV. At the moment this is all it does.
>
> The canceled waiting thread doesn't decrement the waiting threads
> count (cv->waiters) and so the count will never get back to zero,
> and the true last waiter will never notify the broadcasting thread.
>
> I suspect the cleanup handler also needs to check if a broadcast is
> in effect and if it's the last waiting thread, and finish off the
> broadcast if it is.

Lorin Hochstein <lmh@xiphos.ca> already informed about this problem (Wed, 30 Jun
1999) and submitted a bugfix. Ross, please check my reply (Thu, 01 Jul 1999)
too.

--
Peter Slacik



  reply	other threads:[~1999-10-15  5:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-14 21:28 Ross Johnson
1999-10-15  5:25 ` Peter Slacik [this message]
1999-10-16  8:07   ` Ross Johnson

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=38071BF8.1D42C185@TatraMed.sk \
    --to=peter.slacik@tatramed.sk \
    --cc=pthreads-win32@sourceware.cygnus.com \
    --cc=rpj@ise.canberra.edu.au \
    /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).