]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add a method of yielding the current thread with the scheduler
authordeischen <deischen@FreeBSD.org>
Fri, 16 May 2003 19:58:30 +0000 (19:58 +0000)
committerdeischen <deischen@FreeBSD.org>
Fri, 16 May 2003 19:58:30 +0000 (19:58 +0000)
commit7f206ad4bb26e0a2be46cd85318999ccba58875c
treeb51a83e5c85ef7655ee05174c31348fd86fe4591
parent7d7228c36bf498422a9b6bdcb82758abca864f64
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)
28 files changed:
lib/libkse/sys/lock.c
lib/libkse/sys/lock.h
lib/libkse/thread/thr_cond.c
lib/libkse/thread/thr_exit.c
lib/libkse/thread/thr_init.c
lib/libkse/thread/thr_join.c
lib/libkse/thread/thr_kern.c
lib/libkse/thread/thr_mutex.c
lib/libkse/thread/thr_nanosleep.c
lib/libkse/thread/thr_private.h
lib/libkse/thread/thr_sig.c
lib/libkse/thread/thr_sigsuspend.c
lib/libkse/thread/thr_sigwait.c
lib/libkse/thread/thr_yield.c
lib/libpthread/sys/lock.c
lib/libpthread/sys/lock.h
lib/libpthread/thread/thr_cond.c
lib/libpthread/thread/thr_exit.c
lib/libpthread/thread/thr_init.c
lib/libpthread/thread/thr_join.c
lib/libpthread/thread/thr_kern.c
lib/libpthread/thread/thr_mutex.c
lib/libpthread/thread/thr_nanosleep.c
lib/libpthread/thread/thr_private.h
lib/libpthread/thread/thr_sig.c
lib/libpthread/thread/thr_sigsuspend.c
lib/libpthread/thread/thr_sigwait.c
lib/libpthread/thread/thr_yield.c