diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 8f5460270c9e..be0ba859bc6e 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -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);