summaryrefslogtreecommitdiff
path: root/sys/kern/sched_4bsd.c
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2008-03-10 01:30:35 +0000
committerJeff Roberson <jeff@FreeBSD.org>2008-03-10 01:30:35 +0000
commit1e24c28f465fc07cda02077c782afba9a8659066 (patch)
tree136f65ae8dbd50fd9969fc33bc4df882f0c53d26 /sys/kern/sched_4bsd.c
parent23a0c230344bc0b881fa2d3ce40fa8c2f6beabbd (diff)
Notes
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r--sys/kern/sched_4bsd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index fb744038ee45..834788c2faa8 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -1244,6 +1244,17 @@ sched_choose(void)
}
void
+sched_preempt(struct thread *td)
+{
+ thread_lock(td);
+ if (td->td_critnest > 1)
+ td->td_owepreempt = 1;
+ else
+ mi_switch(SW_INVOL | SW_PREEMPT, NULL);
+ thread_unlock(td);
+}
+
+void
sched_userret(struct thread *td)
{
/*