Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Remove the unused and all-but-unusable kthread_destroy(). A...
details: https://anonhg.NetBSD.org/src/rev/56b314a04cea
branches: trunk
changeset: 337620:56b314a04cea
user: pooka <pooka%NetBSD.org@localhost>
date: Tue Apr 21 11:10:29 2015 +0000
description:
Remove the unused and all-but-unusable kthread_destroy(). Also makes
it more obvious that the opposite of kthread_create() is kthread_exit().
diffstat:
distrib/sets/lists/comp/mi | 8 ++++----
share/man/man9/Makefile | 3 +--
share/man/man9/kthread.9 | 12 ++----------
sys/kern/kern_kthread.c | 17 ++---------------
sys/sys/kthread.h | 3 +--
5 files changed, 10 insertions(+), 33 deletions(-)
diffs (152 lines):
diff -r f73f15e00f1c -r 56b314a04cea distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi Tue Apr 21 10:54:52 2015 +0000
+++ b/distrib/sets/lists/comp/mi Tue Apr 21 11:10:29 2015 +0000
@@ -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
diff -r f73f15e00f1c -r 56b314a04cea share/man/man9/Makefile
--- a/share/man/man9/Makefile Tue Apr 21 10:54:52 2015 +0000
+++ b/share/man/man9/Makefile Tue Apr 21 11:10:29 2015 +0000
@@ -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 @@
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 \
diff -r f73f15e00f1c -r 56b314a04cea share/man/man9/kthread.9
--- a/share/man/man9/kthread.9 Tue Apr 21 10:54:52 2015 +0000
+++ b/share/man/man9/kthread.9 Tue Apr 21 11:10:29 2015 +0000
@@ -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 @@
.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.
diff -r f73f15e00f1c -r 56b314a04cea sys/kern/kern_kthread.c
--- a/sys/kern/kern_kthread.c Tue Apr 21 10:54:52 2015 +0000
+++ b/sys/kern/kern_kthread.c Tue Apr 21 11:10:29 2015 +0000
@@ -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 @@
}
/*
- * 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
diff -r f73f15e00f1c -r 56b314a04cea sys/sys/kthread.h
--- a/sys/sys/kthread.h Tue Apr 21 10:54:52 2015 +0000
+++ b/sys/sys/kthread.h Tue Apr 21 11:10:29 2015 +0000
@@ -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 @@
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_ */
Home |
Main Index |
Thread Index |
Old Index