public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: "Bossom, John" <John.Bossom@Cognos.COM>
To: "Romano Paolo Tenca" <rotenca@telvia.it>,
		"Pthreads-Win32 list" <pthreads-win32@sources.redhat.com>
Subject: RE: pthread_cond_destroy and cancel
Date: Tue, 13 Jun 2006 14:03:00 -0000	[thread overview]
Message-ID: <4ABB890A1781774888DB6505E6F0E3B3739E5E@sottemail2.ent.ad.cognos.com> (raw)

I agree that pthread_cond_destroy is not be a cancellation point. It is
not documented as such in the standard.

The fact that it is (now) implemented with a sem_wait, is an
implementation detail that should be isolated from the caller. I would
consider this to be a bug.


Cheers,

John E. Bossom
(still lurking)

-----Original Message-----
From: pthreads-win32-owner@sourceware.org
[mailto:pthreads-win32-owner@sourceware.org] On Behalf Of Romano Paolo
Tenca
Sent: Tuesday, June 13, 2006 6:26 AM
To: Pthreads-Win32 list
Subject: Re: pthread_cond_destroy and cancel

The problem with the code is that pthread_cond_destroy() is a
cancellation point, because it can call sem_wait().

A weak workaround is to call
    pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,NULL);
before pthread_cond_destroy()

BTW, pthread_cond_destroy is not in the list of cancellation points
(pthread_cancel.html).

I think that a destroy function should not be a cancellation point, else
cleanup routine can easy deadlock itself.

--
Romano Paolo Tenca
 
     This message may contain privileged and/or confidential information.  If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so.  Thank you.

             reply	other threads:[~2006-06-13 14:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-13 14:03 Bossom, John [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-06-12 12:27 Romano Paolo Tenca
2006-06-13 10:25 ` Romano Paolo Tenca

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=4ABB890A1781774888DB6505E6F0E3B3739E5E@sottemail2.ent.ad.cognos.com \
    --to=john.bossom@cognos.com \
    --cc=pthreads-win32@sources.redhat.com \
    --cc=rotenca@telvia.it \
    /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).