On Thu Jan 2 17:32:08 EST 2014, quans...@quanstro.net wrote: > On Thu Jan 2 16:55:59 EST 2014, cinap_len...@felloff.net wrote: > > i was investigating all callers of postnote() for bugs that could > > lead to spurious notes like the alarm race i described before. btw > > this has been fixed too. the key is to recheck p->alarm while holding > > p->debug qlock. once you have it, the process cannot exit under you. > > cool. if that's the protocol, doesn't the debug lock need to be held whenever > up->alarm is modified?
checkalarms will hang during rollover. suppose sys->ticks = 1<<31, then (long)((1<<31) - 0) = -2147483648. this will stay negative for a 2147483648/HZ seconds. i think this is necessary: void checkalarms(void) { Proc *p; ulong now; p = alarms.head; now = sys->ticks; if(p != nil) if(p->alarm == 0 || (long)(now - p->alarm) >= 0) wakeup(&alarmr); } - erik