| plan 9 kernel history: overview | file list | diff list |
1990/0331/port/stream.c (diff list | history)
| 1990/03292/sys/src/9/port/stream.c:62,67 – 1990/0331/sys/src/9/port/stream.c:62,89 (short | long | prev | next) | ||
| 1990/0227 | }; /* | |
| 1990/0331 | * Dump all block information of how many blocks are in which queues */ void dumpqueues(void) { Queue *q; int count; Block *bp; for(q = qlist; q < qlist + conf.nqueue; q++, q++){ if(!(q->flag & QINUSE)) continue; for(count = 0, bp = q->first; bp; bp = bp->next) count++; print("%s %ux RD count %d len %d", q->info->name, q, count, q->len); for(count = 0, bp = WR(q)->first; bp; bp = bp->next) count++; print(" WR count %d len %d\n", count, WR(q)->len); } } /* | |
| 1990/0227 | * Allocate streams, queues, and blocks. Allocate n block classes with * 1/2(m+1) to class m < n-1 * 1/2(n-1) to class n-1 | |
| 1990/03292/sys/src/9/port/stream.c:123,130 – 1990/0331/sys/src/9/port/stream.c:145,155 | ||
| 1990/0227 | lock(bcp); while(bcp->first == 0){ unlock(bcp); | |
| 1990/0322 |
| |
| 1990/0331 | if(loop++ > 10){ dumpqueues(); dumpstack(); | |
| 1990/03292 | panic("waiting for blocks\n"); | |
| 1990/0331 | } | |
| 1990/03292 | qlock(bcp); | |
| 1990/0322 | tsleep(&bcp->r, isblock, (void *)bcp, 250); | |
| 1990/03292 | qunlock(bcp); | |
| 1990/03292/sys/src/9/port/stream.c:614,619 – 1990/0331/sys/src/9/port/stream.c:639,645 | ||
| 1990/0227 | * hang a device and process q off the stream */ s->inuse = 1; | |
| 1990/0331 | s->hread = 0; | |
| 1990/0227 | s->tag[0] = 0; q = allocq(&procinfo); s->procq = WR(q); | |
| 1990/03292/sys/src/9/port/stream.c:825,832 – 1990/0331/sys/src/9/port/stream.c:851,862 | ||
| 1990/0227 | while(left){ bp = getq(q); if(bp == 0){ | |
| 1990/0331 | if(q->flag & QHUNGUP){ if(s->hread++ < 3) break; else error(0, Ehungup); } | |
| 1990/0227 | sleep(&q->r, &isinput, (void *)q); continue; } | |