summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_yield.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_yield.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_yield.c')
-rw-r--r--lib/libpthread/thread/thr_yield.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_yield.c b/lib/libpthread/thread/thr_yield.c
index b41072f..5c24113 100644
--- a/lib/libpthread/thread/thr_yield.c
+++ b/lib/libpthread/thread/thr_yield.c
@@ -42,6 +42,9 @@ _sched_yield(void)
{
struct pthread *curthread = _get_curthread();
+ if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM)
+ return (__sys_sched_yield());
+
/* Reset the accumulated time slice value for the current thread: */
curthread->slice_usec = -1;
@@ -57,6 +60,11 @@ _pthread_yield(void)
{
struct pthread *curthread = _get_curthread();
+ if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) {
+ __sys_sched_yield();
+ return;
+ }
+
/* Reset the accumulated time slice value for the current thread: */
curthread->slice_usec = -1;
OpenPOWER on IntegriCloud