From owner-freebsd-stable Tue Apr 30 20:31:40 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mail.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 49F8137B41D for ; Tue, 30 Apr 2002 20:31:36 -0700 (PDT) Received: from localhost (eischen@localhost) by mail.pcnet.com (8.12.1/8.12.1) with ESMTP id g413VYHZ007890; Tue, 30 Apr 2002 23:31:34 -0400 (EDT) Date: Tue, 30 Apr 2002 23:31:34 -0400 (EDT) From: Daniel Eischen To: Archie Cobbs Cc: freebsd-stable@FreeBSD.ORG Subject: Re: Bug in pthread_cancel() In-Reply-To: <200204302302.g3UN2aS89479@arch20m.dellroad.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 30 Apr 2002, Archie Cobbs wrote: > Hi, > Any comments positive or negative to the patch in bin/37614 ? > I'd like to commit this soon... > > http://www.freebsd.org/cgi/query-pr.cgi?pr=37614 The patch is for stable, but would need to be applied to -current first (after some adjustment). Hmm, what about just bypassing the pthread_cancel() if the thread is already in the process of exiting? Index: uthread_cancel.c =================================================================== RCS file: /opt/d/CVS/src/lib/libc_r/uthread/uthread_cancel.c,v retrieving revision 1.12 diff -u -r1.12 uthread_cancel.c --- uthread_cancel.c 6 Mar 2002 19:28:40 -0000 1.12 +++ uthread_cancel.c 1 May 2002 02:35:23 -0000 @@ -20,7 +20,8 @@ if ((ret = _find_thread(pthread)) != 0) { /* NOTHING */ - } else if (pthread->state == PS_DEAD || pthread->state == PS_DEADLOCK) { + } else if (pthread->state == PS_DEAD || pthread->state == PS_DEADLOCK + || (pthread->flags & PTHREAD_EXITING) != 0) { ret = 0; } else { /* Protect the scheduling queues: */ -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message