From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13319 invoked by alias); 13 Jun 2006 10:25:54 -0000 Received: (qmail 13311 invoked by uid 22791); 13 Jun 2006 10:25:53 -0000 X-Spam-Check-By: sourceware.org Received: from efesto.telvia.it (HELO efesto.telvia.it) (213.155.209.50) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 Jun 2006 10:25:51 +0000 Received: from [213.155.204.56] (unverified [213.155.204.56]) by efesto.telvia.it (Vircom SMTPRS 5.3.228) with ESMTP id for ; Tue, 13 Jun 2006 12:26:05 +0200 Message-ID: <448E92AD.5010208@telvia.it> Date: Tue, 13 Jun 2006 10:25:00 -0000 From: Romano Paolo Tenca User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Pthreads-Win32 list Subject: Re: pthread_cond_destroy and cancel References: <448D5D96.4070902@telvia.it> In-Reply-To: <448D5D96.4070902@telvia.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00039.txt.bz2 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