- 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:
parent
30b72f7d93
commit
171a608f92
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user