kern_kthread.c (155919) | kern_kthread.c (166188) |
---|---|
1/*- 2 * Copyright (c) 1999 Peter Wemm <peter@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1999 Peter Wemm <peter@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/kern_kthread.c 155919 2006-02-22 17:21:45Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/kern/kern_kthread.c 166188 2007-01-23 08:46:51Z jeff $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kthread.h> 33#include <sys/lock.h> 34#include <sys/mutex.h> 35#include <sys/proc.h> 36#include <sys/resourcevar.h> 37#include <sys/signalvar.h> 38#include <sys/sx.h> 39#include <sys/unistd.h> 40#include <sys/wait.h> | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kthread.h> 33#include <sys/lock.h> 34#include <sys/mutex.h> 35#include <sys/proc.h> 36#include <sys/resourcevar.h> 37#include <sys/signalvar.h> 38#include <sys/sx.h> 39#include <sys/unistd.h> 40#include <sys/wait.h> |
41#include <sys/sched.h> |
|
41 42#include <machine/stdarg.h> 43 44/* 45 * Start a kernel process. This is called after a fork() call in 46 * mi_startup() in the file kern/init_main.c. 47 * 48 * This function is used to start "internal" daemons and intended --- 59 unchanged lines hidden (view full) --- 108 /* call the processes' main()... */ 109 td = FIRST_THREAD_IN_PROC(p2); 110 cpu_set_fork_handler(td, func, arg); 111 TD_SET_CAN_RUN(td); 112 113 /* Delay putting it on the run queue until now. */ 114 if (!(flags & RFSTOPPED)) { 115 mtx_lock_spin(&sched_lock); | 42 43#include <machine/stdarg.h> 44 45/* 46 * Start a kernel process. This is called after a fork() call in 47 * mi_startup() in the file kern/init_main.c. 48 * 49 * This function is used to start "internal" daemons and intended --- 59 unchanged lines hidden (view full) --- 109 /* call the processes' main()... */ 110 td = FIRST_THREAD_IN_PROC(p2); 111 cpu_set_fork_handler(td, func, arg); 112 TD_SET_CAN_RUN(td); 113 114 /* Delay putting it on the run queue until now. */ 115 if (!(flags & RFSTOPPED)) { 116 mtx_lock_spin(&sched_lock); |
116 setrunqueue(td, SRQ_BORING); | 117 sched_add(td, SRQ_BORING); |
117 mtx_unlock_spin(&sched_lock); 118 } 119 120 return 0; 121} 122 123void 124kthread_exit(int ecode) --- 75 unchanged lines hidden --- | 118 mtx_unlock_spin(&sched_lock); 119 } 120 121 return 0; 122} 123 124void 125kthread_exit(int ecode) --- 75 unchanged lines hidden --- |