summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_init.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-07-17 23:02:30 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-07-17 23:02:30 +0000
commit8cbb5ce67318a92b9504e120b732fb3b549c6023 (patch)
tree501dc66c4a1aec9b0ce29190b9613a1163a1f18a /lib/libpthread/thread/thr_init.c
parent97d2d9dfed7fc1f9fa26e38c42c4de810d167012 (diff)
downloadFreeBSD-src-8cbb5ce67318a92b9504e120b732fb3b549c6023.zip
FreeBSD-src-8cbb5ce67318a92b9504e120b732fb3b549c6023.tar.gz
o Eliminate upcall for PTHREAD_SYSTEM_SCOPE thread, now it
is system bound thread and when it is blocked, no upcall is generated. o Add ability to libkse to allow it run in pure 1:1 threading mode, defining SYSTEM_SCOPE_ONLY in Makefile can turn on this option. o Eliminate code for installing dummy signal handler for sigwait call. o Add hash table to find thread. Reviewed by: deischen
Diffstat (limited to 'lib/libpthread/thread/thr_init.c')
-rw-r--r--lib/libpthread/thread/thr_init.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c
index 202db62..5c31ae7 100644
--- a/lib/libpthread/thread/thr_init.c
+++ b/lib/libpthread/thread/thr_init.c
@@ -259,12 +259,19 @@ _libpthread_init(struct pthread *curthread)
_kse_init();
/* Initialize the initial kse and kseg. */
- _kse_initial = _kse_alloc(NULL);
+#ifdef SYSTEM_SCOPE_ONLY
+ _kse_initial = _kse_alloc(NULL, 1);
+#else
+ _kse_initial = _kse_alloc(NULL, 0);
+#endif
if (_kse_initial == NULL)
PANIC("Can't allocate initial kse.");
_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);
@@ -326,7 +333,9 @@ 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.
*
@@ -463,9 +472,6 @@ init_private(void)
TAILQ_INIT(&_thread_list);
TAILQ_INIT(&_thread_gc_list);
- /* Initialize the SIG_DFL dummy handler count. */
- bzero(_thread_dfl_count, sizeof(_thread_dfl_count));
-
/*
* Initialize the lock for temporary installation of signal
* handlers (to support sigwait() semantics) and for the
OpenPOWER on IntegriCloud