diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-08-18 03:58:29 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-08-18 03:58:29 +0000 |
commit | 3203dde90e7e2cb93d8cfb8292002c02bd4a32d7 (patch) | |
tree | e6cd1320cfc169c79d0f276a0d69df8a3e83fcd4 /lib/libkse/thread/thr_init.c | |
parent | cb79c715dd08db9a90224825647fda99a740a31f (diff) | |
download | FreeBSD-src-3203dde90e7e2cb93d8cfb8292002c02bd4a32d7.zip FreeBSD-src-3203dde90e7e2cb93d8cfb8292002c02bd4a32d7.tar.gz |
Treat initial thread as scope system thread when KSE mode is not activated
yet, so we can protect some locking code from being interrupted by signal
handling. When KSE mode is turned on, reset the thread flag to scope process
except we are running in 1:1 mode which we needn't turn it off.
Also remove some unused member variables in structure kse.
Tested by: deischen
Diffstat (limited to 'lib/libkse/thread/thr_init.c')
-rw-r--r-- | lib/libkse/thread/thr_init.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libkse/thread/thr_init.c b/lib/libkse/thread/thr_init.c index be3ad80..7f60994 100644 --- a/lib/libkse/thread/thr_init.c +++ b/lib/libkse/thread/thr_init.c @@ -268,9 +268,7 @@ _libpthread_init(struct pthread *curthread) _kse_initial->k_kseg = _kseg_alloc(NULL); if (_kse_initial->k_kseg == NULL) PANIC("Can't allocate initial kseg."); -#ifdef SYSTEM_SCOPE_ONLY _kse_initial->k_kseg->kg_flags |= KGF_SINGLE_THREAD; -#endif _kse_initial->k_schedq = &_kse_initial->k_kseg->kg_schedq; TAILQ_INSERT_TAIL(&_kse_initial->k_kseg->kg_kseq, _kse_initial, k_kgqe); @@ -309,6 +307,9 @@ _libpthread_init(struct pthread *curthread) _kcb_set(_thr_initial->kse->k_kcb); _tcb_set(_thr_initial->kse->k_kcb, _thr_initial->tcb); _thr_initial->kse->k_flags |= KF_INITIALIZED; + + _thr_signal_init(); + _kse_critical_leave(&_thr_initial->tcb->tcb_tmbx); } /* @@ -322,9 +323,7 @@ init_main_thread(struct pthread *thread) /* Setup the thread attributes. */ thread->attr = _pthread_attr_default; -#ifdef SYSTEM_SCOPE_ONLY thread->attr.flags |= PTHREAD_SCOPE_SYSTEM; -#endif /* * Set up the thread stack. * |