diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-08-16 13:02:45 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-08-16 13:02:45 +0000 |
commit | 76d162d172781aa8110f4f7146542b1092e42d56 (patch) | |
tree | cfc7ffedbc26d049ae6f0003408e31c0b3243463 | |
parent | 8f0c2fc3c422ef31098d14b8705c53715251cc7f (diff) | |
download | FreeBSD-src-76d162d172781aa8110f4f7146542b1092e42d56.zip FreeBSD-src-76d162d172781aa8110f4f7146542b1092e42d56.tar.gz |
If threaded mode is not turned on yet, direct call __sys_sched_yield.
-rw-r--r-- | lib/libkse/thread/thr_yield.c | 5 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_yield.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/libkse/thread/thr_yield.c b/lib/libkse/thread/thr_yield.c index 5c24113..1133784 100644 --- a/lib/libkse/thread/thr_yield.c +++ b/lib/libkse/thread/thr_yield.c @@ -42,7 +42,7 @@ _sched_yield(void) { struct pthread *curthread = _get_curthread(); - if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) + if (!_kse_isthreaded() || curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) return (__sys_sched_yield()); /* Reset the accumulated time slice value for the current thread: */ @@ -60,7 +60,8 @@ _pthread_yield(void) { struct pthread *curthread = _get_curthread(); - if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) { + if (!_kse_isthreaded() || + curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) { __sys_sched_yield(); return; } diff --git a/lib/libpthread/thread/thr_yield.c b/lib/libpthread/thread/thr_yield.c index 5c24113..1133784 100644 --- a/lib/libpthread/thread/thr_yield.c +++ b/lib/libpthread/thread/thr_yield.c @@ -42,7 +42,7 @@ _sched_yield(void) { struct pthread *curthread = _get_curthread(); - if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) + if (!_kse_isthreaded() || curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) return (__sys_sched_yield()); /* Reset the accumulated time slice value for the current thread: */ @@ -60,7 +60,8 @@ _pthread_yield(void) { struct pthread *curthread = _get_curthread(); - if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) { + if (!_kse_isthreaded() || + curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) { __sys_sched_yield(); return; } |