summaryrefslogtreecommitdiffstats
path: root/lib/libkse/thread/thr_init.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-05-16 19:58:30 +0000
committerdeischen <deischen@FreeBSD.org>2003-05-16 19:58:30 +0000
commit7f206ad4bb26e0a2be46cd85318999ccba58875c (patch)
treeb51a83e5c85ef7655ee05174c31348fd86fe4591 /lib/libkse/thread/thr_init.c
parent7d7228c36bf498422a9b6bdcb82758abca864f64 (diff)
downloadFreeBSD-src-7f206ad4bb26e0a2be46cd85318999ccba58875c.zip
FreeBSD-src-7f206ad4bb26e0a2be46cd85318999ccba58875c.tar.gz
Add a method of yielding the current thread with the scheduler
lock held (_thr_sched_switch_unlocked()) and use this to avoid dropping the scheduler lock and having the scheduler retake the same lock again. Add a better way of detecting if a low-level lock is in use. When switching out a thread due to blocking in the UTS, don't switch to the KSE's scheduler stack only to switch back to another thread. If possible switch to the new thread directly from the old thread and avoid the overhead of the extra context switch. Check for pending signals on a thread when entering the scheduler and add them to the threads signal frame. This includes some other minor signal fixes. Most of this was a joint effor between davidxu and myself. Reviewed by: davidxu Approved by: re@ (blanket for libpthread)
Diffstat (limited to 'lib/libkse/thread/thr_init.c')
-rw-r--r--lib/libkse/thread/thr_init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libkse/thread/thr_init.c b/lib/libkse/thread/thr_init.c
index f06df6c..5bfb3c7 100644
--- a/lib/libkse/thread/thr_init.c
+++ b/lib/libkse/thread/thr_init.c
@@ -72,6 +72,7 @@
int __pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *);
int __pthread_mutex_lock(pthread_mutex_t *);
int __pthread_mutex_trylock(pthread_mutex_t *);
+void _thread_init_hack(void);
static void init_private(void);
static void init_main_thread(struct pthread *thread);
@@ -131,6 +132,7 @@ static void *references[] = {
&_sigsuspend,
&_socket,
&_socketpair,
+ &_thread_init_hack,
&_wait4,
&_write,
&_writev
OpenPOWER on IntegriCloud