proper panic for trying to release implicit lwp

This commit is contained in:
pooka 2010-09-01 21:16:56 +00:00
parent ce29454f2b
commit 32cb61f490
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lwproc.c,v 1.1 2010/09/01 19:37:58 pooka Exp $ */
/* $NetBSD: lwproc.c,v 1.2 2010/09/01 21:16:56 pooka Exp $ */
/*
* Copyright (c) 2010 Antti Kantee. All Rights Reserved.
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lwproc.c,v 1.1 2010/09/01 19:37:58 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: lwproc.c,v 1.2 2010/09/01 21:16:56 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@ -320,6 +320,9 @@ rump_lwproc_releaselwp(void)
struct proc *p;
struct lwp *l = curlwp;
if (l->l_refcnt == 0 && l->l_flag & LW_WEXIT)
panic("releasing non-pertinent lwp");
p = l->l_proc;
mutex_enter(p->p_lock);
KASSERT(l->l_refcnt != 0);