| plan 9 kernel history: overview | file list | diff list |
1992/0602/port/proc.c (diff list | history)
| 1992/0527/sys/src/9/port/proc.c:317,345 – 1992/0602/sys/src/9/port/proc.c:317,348 (short | long | prev | next) | ||
|
Rewrite tsleep to avoid explicit Alarm structures. Now alarm info is in Proc. New tsleep can call regular sleep, avoiding duplicate implementation.
rsc Mon Mar 20 17:14:25 2006 | ||
| 1990/0227 | } void | |
| 1992/0602 | tsleep(Rendez *r, int (*fn)(void*), void *arg, int ms) | |
| 1990/0227 | { | |
| 1991/0727 |
| |
| 1992/0519 |
| |
| 1992/0602 | ulong when; Proc *p, *f, **l, **i; | |
| 1990/0227 | ||
| 1991/0727 | p = u->p; | |
| 1990/0227 |
| |
| 1991/0727 |
| |
| 1992/0602 | when = MS2TK(ms)+MACHP(0)->ticks; i = &talarm.list; lock(&talarm); l = &talarm.list; for(f = talarm.list; f; f = f->tlink) { if(f == p) *l = p->tlink; if(f->twhen && f->twhen < when) i = &f->tlink; l = &f->tlink; | |
| 1991/0727 | } | |
| 1992/0519 |
| |
| 1991/0805 |
| |
| 1992/0519 |
| |
| 1990/11211 |
| |
| 1990/0227 |
| |
| 1992/0602 | p->trend = r; p->twhen = when; p->tlink = *i; *i = p; unlock(&talarm); sleep(r, fn, arg); p->twhen = 0; | |
| 1990/0227 | } void | |
| 1992/0527/sys/src/9/port/proc.c:356,382 – 1992/0602/sys/src/9/port/proc.c:359,368 | ||
| 1991/0705 | if(p->state != Wakeme) panic("wakeup: state"); | |
| 1990/0227 | p->r = 0; | |
| 1992/0319 |
| |
| 1990/0227 | ready(p); } unlock(r); splx(s); | |
| 1990/03091 |
| |
| 1990/0227 | int | |