From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26254 invoked by alias); 13 Jun 2006 14:03:20 -0000 Received: (qmail 26244 invoked by uid 22791); 13 Jun 2006 14:03:19 -0000 X-Spam-Check-By: sourceware.org Received: from mail87.messagelabs.com (HELO mail87.messagelabs.com) (216.82.250.19) by sourceware.org (qpsmtpd/0.31) with SMTP; Tue, 13 Jun 2006 14:03:12 +0000 X-VirusChecked: Checked X-Env-Sender: John.Bossom@Cognos.COM X-Msg-Ref: server-6.tower-87.messagelabs.com!1150207385!2247839!13 X-StarScan-Version: 5.5.10.7; banners=-,-,- Received: (qmail 12818 invoked from network); 13 Jun 2006 14:03:09 -0000 Received: from nomad.cognos.com (HELO nomad.cognos.com) (205.210.232.62) by server-6.tower-87.messagelabs.com with SMTP; 13 Jun 2006 14:03:09 -0000 Received: from sottemail2.ent.ad.cognos.com ([10.67.10.28]) by nomad.cognos.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 13 Jun 2006 10:03:05 -0400 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: pthread_cond_destroy and cancel Date: Tue, 13 Jun 2006 14:03:00 -0000 Message-ID: <4ABB890A1781774888DB6505E6F0E3B3739E5E@sottemail2.ent.ad.cognos.com> From: "Bossom, John" To: "Romano Paolo Tenca" , "Pthreads-Win32 list" X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2006/txt/msg00040.txt.bz2 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 =20 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 atta= chments, delete it immediately from your system and notify the sender promp= tly by e-mail that you have done so. Thank you.