Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jun 2007 10:52:17 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Jeff Roberson <jeff@FreeBSD.org>
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
Message-ID:  <466EDD51.8020504@elischer.org>
In-Reply-To: <200706120724.l5C7Olwd088327@repoman.freebsd.org>
References:  <200706120724.l5C7Olwd088327@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?466EDD51.8020504>