Acquire sched_lock around need_resched() in roundrobin() to satisfy

assertions that it is held.  Since roundrobin() is a timeout there's
no possible way that it could be called with sched_lock held.
This commit is contained in:
Jake Burkholder 2001-02-10 19:07:32 +00:00
parent f580cdd647
commit c11f93b3e7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72330

View File

@ -167,16 +167,12 @@ static void
roundrobin(arg)
void *arg;
{
#ifndef SMP
struct proc *p = curproc; /* XXX */
#endif
#ifdef SMP
mtx_lock_spin(&sched_lock);
need_resched();
mtx_unlock_spin(&sched_lock);
#ifdef SMP
forward_roundrobin();
#else
if (p == PCPU_GET(idleproc) || RTP_PRIO_NEED_RR(p->p_rtprio.type))
need_resched();
#endif
callout_reset(&roundrobin_callout, sched_quantum, roundrobin, NULL);