| plan 9 kernel history: overview | file list | diff list |
1990/0324/port/proc.c (diff list | history)
| 1990/0322/sys/src/9/port/proc.c:364,376 – 1990/0324/sys/src/9/port/proc.c:364,377 (short | long | prev | next) | ||
|
Split Proc.wait back into Proc.wait.use and Proc.wait.queue.
(BUG FIX?)
rsc Mon Mar 20 17:14:01 2006 | ||
| 1990/0227 | * Any of my children exiting? */ | |
| 1990/03081 | while(c->nchild){ | |
| 1990/0322 |
| |
| 1990/0324 | lock(&c->wait.queue); if(canlock(&c->wait.use)){ /* no child is exiting */ | |
| 1990/03081 | c->exiting = 1; | |
| 1990/0322 |
| |
| 1990/0324 | unlock(&c->wait.use); unlock(&c->wait.queue); | |
| 1990/0227 | break; }else{ /* must wait for child */ | |
| 1990/0322 |
| |
| 1990/0324 | unlock(&c->wait.queue); | |
| 1990/0227 | pwait(0); } } | |
| 1990/0322/sys/src/9/port/proc.c:383,389 – 1990/0324/sys/src/9/port/proc.c:384,390 | ||
| 1990/0227 | if(p == 0) goto out; qlock(&p->wait); | |
| 1990/0322 |
| |
| 1990/0324 | lock(&p->wait.queue); | |
| 1990/03081 | if(p->pid==c->parentpid && !p->exiting){ | |
| 1990/0227 | w.pid = mypid; strcpy(w.msg, status); | |
| 1990/0322/sys/src/9/port/proc.c:401,410 – 1990/0324/sys/src/9/port/proc.c:402,411 | ||
| 1990/03081 | c->state = Exiting; | |
| 1990/0227 | if(p->state == Inwait) ready(p); | |
| 1990/0322 |
| |
| 1990/0324 | unlock(&p->wait.queue); | |
| 1990/0227 | sched(); }else{ | |
| 1990/0322 |
| |
| 1990/0324 | unlock(&p->wait.queue); | |
| 1990/0227 | qunlock(&p->wait); } out: | |
| 1990/0322/sys/src/9/port/proc.c:475,501 – 1990/0324/sys/src/9/port/proc.c:476,496 | ||
| 1990/0227 | p = u->p; again: | |
| 1990/0322 |
| |
| 1990/0324 | while(canlock(&p->wait.use)){ | |
| 1990/0227 | if(p->nchild == 0){ | |
| 1990/0322 |
| |
| 1990/0227 | qunlock(&p->wait); error(0, Enochild); } p->state = Inwait; | |
| 1990/0322 |
| |
| 1990/0227 | qunlock(&p->wait); sched(); } | |
| 1990/0322 |
| |
| 1990/0324 | lock(&p->wait.queue); /* wait until child is finished */ | |
| 1990/0227 | c = p->child; if(c == 0){ print("pwait %d\n", p->pid); p->state = Inwait; | |
| 1990/0322 |
| |
| 1990/0324 | unlock(&p->wait.queue); | |
| 1990/0227 | sched(); goto again; } | |
| 1990/0322/sys/src/9/port/proc.c:507,513 – 1990/0324/sys/src/9/port/proc.c:502,508 | ||
| 1990/0227 | p->time[TCSys] += c->time[TSys] + c->time[TCSys]; p->time[TCReal] += c->time[TReal]; p->nchild--; | |
| 1990/0322 |
| |
| 1990/0324 | unlock(&p->wait.queue); | |
| 1990/0227 | qunlock(&p->wait); ready(c); return cpid; | |