kern_thread.c (153253) | kern_thread.c (155195) |
---|---|
1/*- 2 * Copyright (C) 2001 Julian Elischer <julian@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 --- 13 unchanged lines hidden (view full) --- 22 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 26 * DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 2001 Julian Elischer <julian@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 --- 13 unchanged lines hidden (view full) --- 22 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 26 * DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/kern/kern_thread.c 153253 2005-12-09 02:27:55Z davidxu $"); | 30__FBSDID("$FreeBSD: head/sys/kern/kern_thread.c 155195 2006-02-02 00:37:05Z rwatson $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> 37#include <sys/proc.h> 38#include <sys/smp.h> 39#include <sys/sysctl.h> 40#include <sys/sched.h> 41#include <sys/sleepqueue.h> 42#include <sys/turnstile.h> 43#include <sys/ktr.h> 44#include <sys/umtx.h> 45 | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> 37#include <sys/proc.h> 38#include <sys/smp.h> 39#include <sys/sysctl.h> 40#include <sys/sched.h> 41#include <sys/sleepqueue.h> 42#include <sys/turnstile.h> 43#include <sys/ktr.h> 44#include <sys/umtx.h> 45 |
46#include <security/audit/audit.h> 47 |
|
46#include <vm/vm.h> 47#include <vm/vm_extern.h> 48#include <vm/uma.h> 49 50/* 51 * KSEGRP related storage. 52 */ 53static uma_zone_t ksegrp_zone; --- 74 unchanged lines hidden (view full) --- 128 * After a context switch to a newly created thread, it will release 129 * sched_lock for the first time, and its td_critnest will hit 0 for 130 * the first time. This happens on the far end of a context switch, 131 * and when it context switches away from itself, it will in fact go 132 * back into a critical section, and hand off the sched lock to the 133 * next thread. 134 */ 135 td->td_critnest = 1; | 48#include <vm/vm.h> 49#include <vm/vm_extern.h> 50#include <vm/uma.h> 51 52/* 53 * KSEGRP related storage. 54 */ 55static uma_zone_t ksegrp_zone; --- 74 unchanged lines hidden (view full) --- 130 * After a context switch to a newly created thread, it will release 131 * sched_lock for the first time, and its td_critnest will hit 0 for 132 * the first time. This happens on the far end of a context switch, 133 * and when it context switches away from itself, it will in fact go 134 * back into a critical section, and hand off the sched lock to the 135 * next thread. 136 */ 137 td->td_critnest = 1; |
138 139#ifdef AUDIT 140 audit_thread_alloc(td); 141#endif |
|
136 return (0); 137} 138 139/* 140 * Reclaim a thread after use. 141 */ 142static void 143thread_dtor(void *mem, int size, void *arg) --- 902 unchanged lines hidden --- | 142 return (0); 143} 144 145/* 146 * Reclaim a thread after use. 147 */ 148static void 149thread_dtor(void *mem, int size, void *arg) --- 902 unchanged lines hidden --- |