Subject: Re: SZOMB state in lwp_exit2()
To: Bang Jun-Young <junyoung@NetBSD.org>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-kern
Date: 03/04/2004 10:17:10
Bang Jun-Young wrote:
> It's not clear to me why lwp state is set to SZOMB for detached lwp as well, 
> which is very soon to be freed. Wouldn't it be more approproate if it was 
> like this:

Yeah, this would be better. Go ahead :)

Jaromir
 
> Index: kern_lwp.c
> ===================================================================
> RCS file: /cvsroot/src/sys/kern/kern_lwp.c,v
> retrieving revision 1.25
> diff -u -r1.25 kern_lwp.c
> --- kern_lwp.c	2 Mar 2004 09:15:26 -0000	1.25
> +++ kern_lwp.c	4 Mar 2004 06:47:01 -0000
> @@ -596,7 +596,6 @@
>  	 */
>  	uvm_lwp_exit(l);
>  
> -	l->l_stat = LSZOMB;
>  	if (l->l_flag & L_DETACHED) {
>  		/* Nobody waits for detached LWPs. */
>  
> @@ -609,6 +608,7 @@
>  		pool_put(&lwp_pool, l);
>  		KERNEL_UNLOCK();
>  	} else {
> +		l->l_stat = LSZOMB;
>  		p = l->l_proc;
>  		p->p_nzlwps++;
>  		KERNEL_UNLOCK();
> 
> Jun-Young
> 

-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you        -=-
-=- sometimes levitate or glow.   Do not let this distract you.''   -=-