thr_init.c (113658) | thr_init.c (113661) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2003 Daniel M. Eischen <deischen@FreeBSD.org> | 2 * Copyright (c) 2003 Daniel M. Eischen <deischen@freebsd.org> |
3 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. --- 14 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * | 3 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. --- 14 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * |
33 * $FreeBSD: head/lib/libkse/thread/thr_init.c 113658 2003-04-18 05:04:16Z deischen $ | 33 * $FreeBSD: head/lib/libkse/thread/thr_init.c 113661 2003-04-18 07:09:43Z deischen $ |
34 */ 35 36/* Allocate space for global thread variables here: */ 37#define GLOBAL_PTHREAD_PRIVATE 38 39#include "namespace.h" 40#include <sys/param.h> 41#include <sys/types.h> --- 233 unchanged lines hidden (view full) --- 275 } else { 276 /* 277 * The initial thread is the current thread. It is 278 * assumed that the current thread is already initialized 279 * because it is left over from a fork(). 280 */ 281 _thr_initial = curthread; 282 } | 34 */ 35 36/* Allocate space for global thread variables here: */ 37#define GLOBAL_PTHREAD_PRIVATE 38 39#include "namespace.h" 40#include <sys/param.h> 41#include <sys/types.h> --- 233 unchanged lines hidden (view full) --- 275 } else { 276 /* 277 * The initial thread is the current thread. It is 278 * assumed that the current thread is already initialized 279 * because it is left over from a fork(). 280 */ 281 _thr_initial = curthread; 282 } |
283 _kse_initial->k_kseg->kg_threadcount = 1; | 283 _kse_initial->k_kseg->kg_threadcount = 0; |
284 _thr_initial->kse = _kse_initial; 285 _thr_initial->kseg = _kse_initial->k_kseg; 286 _thr_initial->active = 1; 287 288 /* 289 * Add the thread to the thread list and to the KSEG's thread 290 * queue. 291 */ 292 THR_LIST_ADD(_thr_initial); | 284 _thr_initial->kse = _kse_initial; 285 _thr_initial->kseg = _kse_initial->k_kseg; 286 _thr_initial->active = 1; 287 288 /* 289 * Add the thread to the thread list and to the KSEG's thread 290 * queue. 291 */ 292 THR_LIST_ADD(_thr_initial); |
293 TAILQ_INSERT_TAIL(&_kse_initial->k_kseg->kg_threadq, _thr_initial, kle); | 293 KSEG_THRQ_ADD(_kse_initial->k_kseg, _thr_initial); |
294 295 /* Setup the KSE/thread specific data for the current KSE/thread. */ 296 if (_ksd_setprivate(&_thr_initial->kse->k_ksd) != 0) 297 PANIC("Can't set initial KSE specific data"); 298 _set_curkse(_thr_initial->kse); 299 _thr_initial->kse->k_curthread = _thr_initial; 300 _thr_initial->kse->k_flags |= KF_INITIALIZED; 301 _kse_initial->k_curthread = _thr_initial; --- 218 unchanged lines hidden --- | 294 295 /* Setup the KSE/thread specific data for the current KSE/thread. */ 296 if (_ksd_setprivate(&_thr_initial->kse->k_ksd) != 0) 297 PANIC("Can't set initial KSE specific data"); 298 _set_curkse(_thr_initial->kse); 299 _thr_initial->kse->k_curthread = _thr_initial; 300 _thr_initial->kse->k_flags |= KF_INITIALIZED; 301 _kse_initial->k_curthread = _thr_initial; --- 218 unchanged lines hidden --- |