On Thu Jan 2 17:54:50 EST 2014, cinap_len...@felloff.net wrote: > no. the debug qlock is so the process wont exit. once you hold it, > the process might be running, might be in the process of exiting > might have been already exited or might have been reused. > > the key here is that while you hold it. it wont make it to the > process freelist when not already there. it wont change > from "exiting -> exited". but it wont prevent it from being > reused when it was exited already... but... > > pexit() zeros p->alarm. and p->alarm can not be set to non-zero > value again while we hold the alarms qlock in the kproc! > > so this actually works. >
the code says you can set alarm = 0 without holding the alarms lock. ulong procalarm(ulong time) { Proc **l, *f; ulong when, old; if(up->alarm) old = tk2ms(up->alarm - sys->ticks); else old = 0; if(time == 0) { >> up->alarm = 0; >> return old; - erik