aboutsummaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_sigsuspend.c
diff options
context:
space:
mode:
authorDaniel Eischen <deischen@FreeBSD.org>2003-05-16 19:58:30 +0000
committerDaniel Eischen <deischen@FreeBSD.org>2003-05-16 19:58:30 +0000
commitfd626336fd97bad05a86f02b646c66d2fe14d01a (patch)
treeb51a83e5c85ef7655ee05174c31348fd86fe4591 /lib/libpthread/thread/thr_sigsuspend.c
parent72a3951459cd8937c6b6f0b43804c39889c4ae30 (diff)
downloadsrc-fd626336fd97bad05a86f02b646c66d2fe14d01a.tar.gz
src-fd626336fd97bad05a86f02b646c66d2fe14d01a.zip
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)
Notes
Notes: svn path=/head/; revision=115080
Diffstat (limited to 'lib/libpthread/thread/thr_sigsuspend.c')
-rw-r--r--lib/libpthread/thread/thr_sigsuspend.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libpthread/thread/thr_sigsuspend.c b/lib/libpthread/thread/thr_sigsuspend.c
index 9ada1b2bb984..59161566bb51 100644
--- a/lib/libpthread/thread/thr_sigsuspend.c
+++ b/lib/libpthread/thread/thr_sigsuspend.c
@@ -57,9 +57,7 @@ _sigsuspend(const sigset_t *set)
THR_SET_STATE(curthread, PS_SIGSUSPEND);
/* Wait for a signal: */
- _thr_sched_switch(curthread);
-
- THR_UNLOCK_SWITCH(curthread);
+ _thr_sched_switch_unlocked(curthread);
/* Always return an interrupted error: */
errno = EINTR;