From a66fde8d35931c0e32ac294a1a2c1bf6b877425f Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 7 Jun 2007 19:45:19 +0000 Subject: [PATCH] - Remove unused variable from create_thread(). - Move kern_thr_*() prototype to where all the other kern_*() prototypes live. --- sys/kern/kern_thr.c | 3 +-- sys/sys/syscallsubr.h | 3 +++ sys/sys/thr.h | 5 +---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 33ec6c49e616..bcbe1685c4c1 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -143,7 +144,6 @@ create_thread(struct thread *td, mcontext_t *ctx, stack_t stack; struct thread *newtd; struct proc *p; - long id; int error; error = 0; @@ -183,7 +183,6 @@ create_thread(struct thread *td, mcontext_t *ctx, * its storage, because child thread may exit quickly and * memory is freed before parent thread can access it. */ - id = newtd->td_tid; if ((child_tid != NULL && suword_lwpid(child_tid, newtd->td_tid)) || (parent_tid != NULL && diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index a426b29ef7b5..1cba85dcfed2 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -48,6 +48,7 @@ struct stat; struct kevent; struct kevent_copyops; struct sendfile_args; +struct thr_param; int kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg, u_int buflen); @@ -168,6 +169,8 @@ int kern_statfs(struct thread *td, char *path, enum uio_seg pathseg, struct statfs *buf); int kern_symlink(struct thread *td, char *path, char *link, enum uio_seg segflg); +int kern_thr_new(struct thread *td, struct thr_param *param); +int kern_thr_suspend(struct thread *td, struct timespec *tsp); int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, off_t length); int kern_unlink(struct thread *td, char *path, enum uio_seg pathseg); diff --git a/sys/sys/thr.h b/sys/sys/thr.h index bcf1ef99816a..6331a7ae9e14 100644 --- a/sys/sys/thr.h +++ b/sys/sys/thr.h @@ -64,10 +64,7 @@ int thr_kill(long id, int sig); int thr_suspend(const struct timespec *timeout); int thr_wake(long id); int thr_set_name(long id, const char *name); -#else -struct thread; -int kern_thr_new(struct thread *td, struct thr_param *param); -int kern_thr_suspend(struct thread *, struct timespec *); + #endif /* !_KERNEL */ #endif /* ! _SYS_THR_H_ */