Deleted Added
full compact
kern_exit.c (172930) kern_exit.c (173004)
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
35 */
36
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/kern/kern_exit.c 172930 2007-10-24 19:04:04Z rwatson $");
38__FBSDID("$FreeBSD: head/sys/kern/kern_exit.c 173004 2007-10-26 08:00:41Z julian $");
39
40#include "opt_compat.h"
41#include "opt_ktrace.h"
42#include "opt_mac.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/sysproto.h>

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

131 WTERMSIG(rv), WEXITSTATUS(rv));
132 panic("Going nowhere without my init!");
133 }
134
135 /*
136 * MUST abort all other threads before proceeding past here.
137 */
138 PROC_LOCK(p);
39
40#include "opt_compat.h"
41#include "opt_ktrace.h"
42#include "opt_mac.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/sysproto.h>

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

131 WTERMSIG(rv), WEXITSTATUS(rv));
132 panic("Going nowhere without my init!");
133 }
134
135 /*
136 * MUST abort all other threads before proceeding past here.
137 */
138 PROC_LOCK(p);
139 if (p->p_flag & P_HADTHREADS) {
140retry:
139 while (p->p_flag & P_HADTHREADS) {
141 /*
142 * First check if some other thread got here before us..
143 * if so, act apropriatly, (exit or suspend);
144 */
145 thread_suspend_check(0);
146
147 /*
148 * Kill off the other threads. This requires

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

156 * to return to userland will thread_exit() from userret().
157 * thread_exit() will unsuspend us when the last of the
158 * other threads exits.
159 * If there is already a thread singler after resumption,
160 * calling thread_single will fail; in that case, we just
161 * re-check all suspension request, the thread should
162 * either be suspended there or exit.
163 */
140 /*
141 * First check if some other thread got here before us..
142 * if so, act apropriatly, (exit or suspend);
143 */
144 thread_suspend_check(0);
145
146 /*
147 * Kill off the other threads. This requires

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

155 * to return to userland will thread_exit() from userret().
156 * thread_exit() will unsuspend us when the last of the
157 * other threads exits.
158 * If there is already a thread singler after resumption,
159 * calling thread_single will fail; in that case, we just
160 * re-check all suspension request, the thread should
161 * either be suspended there or exit.
162 */
164 if (thread_single(SINGLE_EXIT))
165 goto retry;
163 if (! thread_single(SINGLE_EXIT))
164 break;
166
167 /*
168 * All other activity in this process is now stopped.
169 * Threading support has been turned off.
170 */
171 }
172 KASSERT(p->p_numthreads == 1,
173 ("exit1: proc %p exiting with %d threads", p, p->p_numthreads));

--- 707 unchanged lines hidden ---
165
166 /*
167 * All other activity in this process is now stopped.
168 * Threading support has been turned off.
169 */
170 }
171 KASSERT(p->p_numthreads == 1,
172 ("exit1: proc %p exiting with %d threads", p, p->p_numthreads));

--- 707 unchanged lines hidden ---