From owner-cvs-src@FreeBSD.ORG Tue Jun 12 17:52:19 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 485F016A46C for ; Tue, 12 Jun 2007 17:52:19 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outX.internet-mail-service.net (outX.internet-mail-service.net [216.240.47.247]) by mx1.freebsd.org (Postfix) with ESMTP id 3677A13C457 for ; Tue, 12 Jun 2007 17:52:19 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.32) with ESMTP; Tue, 12 Jun 2007 10:52:18 -0700 Received: from julian-mac.elischer.org (nat.ironport.com [63.251.108.100]) by idiom.com (Postfix) with ESMTP id 10F14125B4F; Tue, 12 Jun 2007 10:52:18 -0700 (PDT) Message-ID: <466EDD51.8020504@elischer.org> Date: Tue, 12 Jun 2007 10:52:17 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.0 (Macintosh/20070326) MIME-Version: 1.0 To: Jeff Roberson References: <200706120724.l5C7Olwd088327@repoman.freebsd.org> In-Reply-To: <200706120724.l5C7Olwd088327@repoman.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys proc.h src/sys/kern kern_thread.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2007 17:52:19 -0000 Jeff Roberson wrote: > jeff 2007-06-12 07:24:47 UTC > > FreeBSD src repository > > Modified files: > sys/sys proc.h > sys/kern kern_thread.c > Log: > Solve a complex exit race introduced with thread_lock: > - Add a count of exiting threads, p_exitthreads, to struct proc. > - Increment p_exithreads when we set the deadthread in thread_exit(). > - When we thread_stash() a deadthread use an atomic to drop the count. > - Spin until the p_exithreads count reaches 0 in thread_wait(). > - Lock the last exiting thread momentarily to be certain that it has > exited cpu_throw(). > - Restructure thread_wait(). It does not need a loop as there will only > ever be one thread. I think I was being paranoid.. also called "being on the safe side". > > Tested by: moose@opera.com > Reported by: kris, moose@opera.com > > Revision Changes Path > 1.249 +33 -15 src/sys/kern/kern_thread.c > 1.484 +1 -0 src/sys/sys/proc.h