1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-11 09:50:12 +00:00

If threaded mode is not turned on yet, direct call __sys_sched_yield.

This commit is contained in:
David Xu 2003-08-16 13:02:45 +00:00
parent 1d29b48683
commit 4e7370ed1f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118989
2 changed files with 6 additions and 4 deletions

View File

@ -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;
}

View File

@ -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;
}