Store l_name for kernel threads.

This commit is contained in:
pooka 2010-02-09 16:53:13 +00:00
parent db6e663a4c
commit 2f3605b79c
2 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rump.c,v 1.151 2010/01/15 20:39:46 pooka Exp $ */
/* $NetBSD: rump.c,v 1.152 2010/02/09 16:53:13 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.151 2010/01/15 20:39:46 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.152 2010/02/09 16:53:13 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@ -502,6 +502,8 @@ rump_lwp_free(struct lwp *l)
KASSERT(l->l_flag & LW_WEXIT);
KASSERT(l->l_mutex == NULL);
if (l->l_name)
kmem_free(l->l_name, MAXCOMLEN);
kmem_free(l, sizeof(*l));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: threads.c,v 1.7 2010/01/27 20:16:16 pooka Exp $ */
/* $NetBSD: threads.c,v 1.8 2010/02/09 16:53:13 pooka Exp $ */
/*
* Copyright (c) 2007-2009 Antti Kantee. All Rights Reserved.
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: threads.c,v 1.7 2010/01/27 20:16:16 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: threads.c,v 1.8 2010/02/09 16:53:13 pooka Exp $");
#include <sys/param.h>
#include <sys/kmem.h>
@ -144,6 +144,11 @@ kthread_create(pri_t pri, int flags, struct cpu_info *ci,
l->l_pflag |= LP_BOUND;
l->l_cpu = ci;
}
if (thrname) {
l->l_name = kmem_alloc(MAXCOMLEN, KM_SLEEP);
strlcpy(l->l_name, thrname, MAXCOMLEN);
}
rv = rumpuser_thread_create(threadbouncer, k, thrname);
if (rv)
return rv;