- Add a sched_preempt() routine to be called by md code after IPI_PREEMPT is

delivered.
 - Add a simple implementation to 4bsd.
This commit is contained in:
jeff 2008-03-10 01:30:35 +00:00
parent 30b72f7d93
commit 171a608f92
2 changed files with 12 additions and 0 deletions

View File

@ -1243,6 +1243,17 @@ sched_choose(void)
return (PCPU_GET(idlethread));
}
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)
{

View File

@ -108,6 +108,7 @@ void sched_unlend_user_prio(struct thread *td, u_char pri);
void sched_user_prio(struct thread *td, u_char prio);
void sched_userret(struct thread *td);
void sched_wakeup(struct thread *td);
void sched_preempt(struct thread *td);
/*
* Threads are moved on and off of run queues