summaryrefslogtreecommitdiffstats
path: root/sys/posix4
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-06-15 06:37:39 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-06-15 06:37:39 +0000
commita4976ce4819998468c1e5c81438c6e85194d9eed (patch)
tree54e94fb49d889ce7133d0d6bc666318bb347cc77 /sys/posix4
parentb3a7439a45bf95ef2c21dfad6ba1a051467efad1 (diff)
downloadFreeBSD-src-a4976ce4819998468c1e5c81438c6e85194d9eed.zip
FreeBSD-src-a4976ce4819998468c1e5c81438c6e85194d9eed.tar.gz
Add scheduler API sched_relinquish(), the API is used to implement
yield() and sched_yield() syscalls. Every scheduler has its own way to relinquish cpu, the ULE and CORE schedulers have two internal run- queues, a timesharing thread which calls yield() syscall should be moved to inactive queue.
Diffstat (limited to 'sys/posix4')
-rw-r--r--sys/posix4/ksched.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/posix4/ksched.c b/sys/posix4/ksched.c
index c4a5f0b..7884d90 100644
--- a/sys/posix4/ksched.c
+++ b/sys/posix4/ksched.c
@@ -253,9 +253,7 @@ ksched_getscheduler(register_t *ret, struct ksched *ksched, struct thread *td)
int
ksched_yield(register_t *ret, struct ksched *ksched)
{
- mtx_lock_spin(&sched_lock);
- curthread->td_flags |= TDF_NEEDRESCHED;
- mtx_unlock_spin(&sched_lock);
+ sched_relinquish(curthread);
return 0;
}
OpenPOWER on IntegriCloud