From e81bbed597a0ea8392ded3f1161aa98151c496a5 Mon Sep 17 00:00:00 2001 From: David Xu Date: Mon, 18 Aug 2003 03:58:29 +0000 Subject: 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 --- lib/libpthread/thread/thr_init.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/libpthread/thread/thr_init.c') diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c index be3ad8072756..7f6099458d8c 100644 --- a/lib/libpthread/thread/thr_init.c +++ b/lib/libpthread/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. * -- cgit v1.2.3