summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_yield.c
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2003-07-17 23:02:30 +0000
committerDavid Xu <davidxu@FreeBSD.org>2003-07-17 23:02:30 +0000
commit090b336154a0d8570ea8fad84e60e7d49aa801e7 (patch)
tree501dc66c4a1aec9b0ce29190b9613a1163a1f18a /lib/libpthread/thread/thr_yield.c
parent3074d1b454e37e25facad76e56d2a05317f9e751 (diff)
Notes
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 b41072fdd1f8..5c24113c2767 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;