PREEMPT(9)

NAME
preempt - general preempt function

SYNOPSIS
#include <sys/proc.h>
#include <sys/sched.h>
void
preempt(struct proc *p);

DESCRIPTION
The preempt() function puts the current process back on the system run queue and performs an involuntary context switch. If the specified process argument p is not NULL then a context switch is done to that process. Otherwise, the normal process selection criteria inside mi_switch(9) is used to select the new process.

The preempt() function must not be called with the scheduler lock held.

SEE ALSO
mi_switch(9), setrunqueue(9), userret(9)