diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-06-15 06:37:39 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-06-15 06:37:39 +0000 |
commit | a4976ce4819998468c1e5c81438c6e85194d9eed (patch) | |
tree | 54e94fb49d889ce7133d0d6bc666318bb347cc77 /sys/kern/ksched.c | |
parent | b3a7439a45bf95ef2c21dfad6ba1a051467efad1 (diff) | |
download | FreeBSD-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/kern/ksched.c')
-rw-r--r-- | sys/kern/ksched.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/ksched.c b/sys/kern/ksched.c index c4a5f0b..7884d90 100644 --- a/sys/kern/ksched.c +++ b/sys/kern/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; } |