Deleted Added
full compact
kern_kthread.c (71559) kern_kthread.c (72200)
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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 *
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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/sys/kern/kern_kthread.c 71559 2001-01-24 10:47:50Z jhb $
26 * $FreeBSD: head/sys/kern/kern_kthread.c 72200 2001-02-09 06:11:45Z bmilekic $
27 */
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/proc.h>
32#include <sys/kthread.h>
33#include <sys/lock.h>
34#include <sys/resourcevar.h>

--- 63 unchanged lines hidden (view full) ---

98 va_start(ap, fmt);
99 vsnprintf(p2->p_comm, sizeof(p2->p_comm), fmt, ap);
100 va_end(ap);
101
102 /* call the processes' main()... */
103 cpu_set_fork_handler(p2, func, arg);
104
105 /* Delay putting it on the run queue until now. */
27 */
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/proc.h>
32#include <sys/kthread.h>
33#include <sys/lock.h>
34#include <sys/resourcevar.h>

--- 63 unchanged lines hidden (view full) ---

98 va_start(ap, fmt);
99 vsnprintf(p2->p_comm, sizeof(p2->p_comm), fmt, ap);
100 va_end(ap);
101
102 /* call the processes' main()... */
103 cpu_set_fork_handler(p2, func, arg);
104
105 /* Delay putting it on the run queue until now. */
106 mtx_enter(&sched_lock, MTX_SPIN);
106 mtx_lock_spin(&sched_lock);
107 p2->p_sflag |= PS_INMEM;
108 if (!(flags & RFSTOPPED)) {
109 p2->p_stat = SRUN;
110 setrunqueue(p2);
111 }
107 p2->p_sflag |= PS_INMEM;
108 if (!(flags & RFSTOPPED)) {
109 p2->p_stat = SRUN;
110 setrunqueue(p2);
111 }
112 mtx_exit(&sched_lock, MTX_SPIN);
112 mtx_unlock_spin(&sched_lock);
113
114 return 0;
115}
116
117void
118kthread_exit(int ecode)
119{
120

--- 45 unchanged lines hidden ---
113
114 return 0;
115}
116
117void
118kthread_exit(int ecode)
119{
120

--- 45 unchanged lines hidden ---