Module Name: src Committed By: pooka Date: Tue Apr 21 11:10:29 UTC 2015
Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man9: Makefile kthread.9 src/sys/kern: kern_kthread.c src/sys/sys: kthread.h Log Message: Remove the unused and all-but-unusable kthread_destroy(). Also makes it more obvious that the opposite of kthread_create() is kthread_exit(). To generate a diff of this commit: cvs rdiff -u -r1.1953 -r1.1954 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.383 -r1.384 src/share/man/man9/Makefile cvs rdiff -u -r1.27 -r1.28 src/share/man/man9/kthread.9 cvs rdiff -u -r1.40 -r1.41 src/sys/kern/kern_kthread.c cvs rdiff -u -r1.12 -r1.13 src/sys/sys/kthread.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1953 src/distrib/sets/lists/comp/mi:1.1954 --- src/distrib/sets/lists/comp/mi:1.1953 Fri Apr 17 20:14:27 2015 +++ src/distrib/sets/lists/comp/mi Tue Apr 21 11:10:29 2015 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1953 2015/04/17 20:14:27 christos Exp $ +# $NetBSD: mi,v 1.1954 2015/04/21 11:10:29 pooka Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -10447,7 +10447,7 @@ ./usr/share/man/cat9/kthread.0 comp-sys-catman .cat ./usr/share/man/cat9/kthread_create.0 comp-sys-catman .cat ./usr/share/man/cat9/kthread_create1.0 comp-obsolete obsolete -./usr/share/man/cat9/kthread_destroy.0 comp-sys-catman .cat +./usr/share/man/cat9/kthread_destroy.0 comp-obsolete obsolete ./usr/share/man/cat9/kthread_exit.0 comp-sys-catman .cat ./usr/share/man/cat9/kthread_join.0 comp-sys-catman .cat ./usr/share/man/cat9/le16dec.0 comp-sys-catman .cat @@ -17224,7 +17224,7 @@ ./usr/share/man/html9/kpsignal.html comp-sys-htmlman html ./usr/share/man/html9/kthread.html comp-sys-htmlman html ./usr/share/man/html9/kthread_create.html comp-sys-htmlman html -./usr/share/man/html9/kthread_destroy.html comp-sys-htmlman html +./usr/share/man/html9/kthread_destroy.html comp-obsolete obsolete ./usr/share/man/html9/kthread_exit.html comp-sys-htmlman html ./usr/share/man/html9/kthread_join.html comp-sys-htmlman html ./usr/share/man/html9/le16dec.html comp-sys-htmlman html @@ -24159,7 +24159,7 @@ ./usr/share/man/man9/kthread.9 comp-sys-man .man ./usr/share/man/man9/kthread_create.9 comp-sys-man .man ./usr/share/man/man9/kthread_create1.9 comp-obsolete obsolete -./usr/share/man/man9/kthread_destroy.9 comp-sys-man .man +./usr/share/man/man9/kthread_destroy.9 comp-obsolete obsolete ./usr/share/man/man9/kthread_exit.9 comp-sys-man .man ./usr/share/man/man9/kthread_join.9 comp-sys-man .man ./usr/share/man/man9/le16dec.9 comp-sys-man .man Index: src/share/man/man9/Makefile diff -u src/share/man/man9/Makefile:1.383 src/share/man/man9/Makefile:1.384 --- src/share/man/man9/Makefile:1.383 Mon Mar 30 01:25:36 2015 +++ src/share/man/man9/Makefile Tue Apr 21 11:10:29 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.383 2015/03/30 01:25:36 riastradh Exp $ +# $NetBSD: Makefile,v 1.384 2015/04/21 11:10:29 pooka Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -445,7 +445,6 @@ MLINKS+=kprintf.9 printf.9 kprintf.9 pri kprintf.9 device_printf.9 MLINKS+=kthread.9 kthread_exit.9 \ kthread.9 kthread_create.9 \ - kthread.9 kthread_destroy.9 \ kthread.9 kthread_join.9 MLINKS+=linedisc.9 ttyldisc_add.9 \ linedisc.9 ttyldisc_lookup.9 \ Index: src/share/man/man9/kthread.9 diff -u src/share/man/man9/kthread.9:1.27 src/share/man/man9/kthread.9:1.28 --- src/share/man/man9/kthread.9:1.27 Sun Aug 7 14:03:16 2011 +++ src/share/man/man9/kthread.9 Tue Apr 21 11:10:29 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: kthread.9,v 1.27 2011/08/07 14:03:16 rmind Exp $ +.\" $NetBSD: kthread.9,v 1.28 2015/04/21 11:10:29 pooka Exp $ .\" .\" Copyright (c) 2000, 2007, 2008 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,12 +27,11 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 7, 2011 +.Dd April 21, 2015 .Dt KTHREAD 9 .Os .Sh NAME .Nm kthread_create , -.Nm kthread_destroy , .Nm kthread_exit , .Nm kthread_join .Nd kernel threads @@ -42,8 +41,6 @@ .Fn kthread_create "pri_t pri" "int flags" "struct cpu_info *ci" \ "void (*func)(void *)" "void *arg" "lwp_t **newlp" "const char *fmt" "..." .Ft void -.Fn kthread_destroy "lwp_t *l" -.Ft void .Fn kthread_exit "int ecode" .Ft int .Fn kthread_join "lwp_t *l" @@ -146,11 +143,6 @@ will wait until .Fn kthread_join will be called. .El -.It Fn kthread_destroy "l" -From another thread executing in the kernel, cause a kthread to exit. -The kthread must be in the -.Dv LSIDL -(idle) state. .It Fn kthread_exit "ecode" Exit from a kernel thread. Must only be called by a kernel thread. Index: src/sys/kern/kern_kthread.c diff -u src/sys/kern/kern_kthread.c:1.40 src/sys/kern/kern_kthread.c:1.41 --- src/sys/kern/kern_kthread.c:1.40 Tue Apr 21 10:54:52 2015 +++ src/sys/kern/kern_kthread.c Tue Apr 21 11:10:29 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_kthread.c,v 1.40 2015/04/21 10:54:52 pooka Exp $ */ +/* $NetBSD: kern_kthread.c,v 1.41 2015/04/21 11:10:29 pooka Exp $ */ /*- * Copyright (c) 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.40 2015/04/21 10:54:52 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.41 2015/04/21 11:10:29 pooka Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -187,19 +187,6 @@ kthread_exit(int ecode) } /* - * Destroy an inactive kthread. The kthread must be in the LSIDL state. - */ -void -kthread_destroy(lwp_t *l) -{ - - KASSERT((l->l_flag & LW_SYSTEM) != 0); - KASSERT(l->l_stat == LSIDL); - - lwp_exit(l); -} - -/* * Wait for a kthread to exit, as pthread_join(). */ int Index: src/sys/sys/kthread.h diff -u src/sys/sys/kthread.h:1.12 src/sys/sys/kthread.h:1.13 --- src/sys/sys/kthread.h:1.12 Mon Nov 21 04:36:05 2011 +++ src/sys/sys/kthread.h Tue Apr 21 11:10:29 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kthread.h,v 1.12 2011/11/21 04:36:05 christos Exp $ */ +/* $NetBSD: kthread.h,v 1.13 2015/04/21 11:10:29 pooka Exp $ */ /*- * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc. @@ -54,7 +54,6 @@ void kthread_sysinit(void); int kthread_create(pri_t, int, struct cpu_info *, void (*)(void *), void *, lwp_t **, const char *, ...) __printflike(7, 8); void kthread_exit(int) __dead; -void kthread_destroy(lwp_t *); int kthread_join(lwp_t *); #endif /* _SYS_KTHREAD_H_ */