- correct comment - correct preempted. we may not preempt a process with locks. (currently overkill due to how preempted is called) Reference: /n/atom/patch/applied/procnit Date: Fri May 2 22:50:10 CES 2014 Signed-off-by: quanstro@quanstro.net --- /sys/src/nix/port/proc.c Fri May 2 22:49:15 2014 +++ /sys/src/nix/port/proc.c Fri May 2 22:49:15 2014 @@ -197,14 +197,6 @@ * it is holding. This avoids dumb lock loops. * Don't delay if the process is Moribund. * It called sched to die. - * But do sched eventually. This avoids a missing unlock - * from hanging the entire kernel. - * But don't reschedule procs holding palloc or procalloc. - * Those are far too important to be holding while asleep. - * - * This test is not exact. There can still be a few - * instructions in the middle of taslock when a process - * holds a lock but Lock.p has not yet been initialized. */ if(up->nlocks && up->state != Moribund){ up->delaysched++; @@ -289,7 +281,8 @@ int preempted(void) { - if(up && up->state == Running) + if(m->ilockdepth == 0 && up->nlocks == 0) + if(up->state == Running) if(up->preempted == 0) if(anyhigher()) if(!active.exiting){