| plan 9 kernel history: overview | file list | diff list |
1990/0403/gnot/stream.c (diff list | history)
| 1990/0331/sys/src/9/gnot/stream.c:145,154 – 1990/0403/sys/src/9/gnot/stream.c:145,153 (short | long | prev | next) | ||
| 1990/03091 | lock(bcp); while(bcp->first == 0){ unlock(bcp); | |
| 1990/0331 |
| |
| 1990/0403 | if(loop++ == 10){ | |
| 1990/0331 | dumpqueues(); | |
| 1990/0322 |
| |
| 1990/0403 | print("waiting for blocks\n"); | |
| 1990/0331 | } | |
| 1990/0312 | qlock(bcp); | |
| 1990/0322 | tsleep(&bcp->r, isblock, (void *)bcp, 250); | |
| 1990/0331/sys/src/9/gnot/stream.c:230,235 – 1990/0403/sys/src/9/gnot/stream.c:229,235 | ||
| 1990/03091 | q->r.p = 0; q->info = qi; q->put = qi->iput; | |
| 1990/0403 | q->len = q->nb = 0; | |
| 1990/03091 | wq = q->other = q + 1; wq->r.p = 0; | |
| 1990/0331/sys/src/9/gnot/stream.c:236,241 – 1990/0403/sys/src/9/gnot/stream.c:236,242 | ||
| 1990/03091 | wq->info = qi; wq->put = qi->oput; wq->other = q; | |
| 1990/0403 | wq->len = wq->nb = 0; | |
| 1990/03091 | unlock(q); | |
| 1990/0331/sys/src/9/gnot/stream.c:323,336 – 1990/0403/sys/src/9/gnot/stream.c:324,339 | ||
| 1990/03091 | else q->first = bp; | |
| 1990/0312 | q->len += BLEN(bp); | |
| 1990/0403 | q->nb++; | |
| 1990/03091 | delim = bp->flags & S_DELIM; while(bp->next) { bp = bp->next; | |
| 1990/0312 | q->len += BLEN(bp); | |
| 1990/0403 | q->nb++; | |
| 1990/03091 | delim |= bp->flags & S_DELIM; } q->last = bp; | |
| 1990/0403 | if(q->len >= Streamhi || q->nb >= Streambhi) | |
| 1990/03091 | q->flag |= QHIWAT; unlock(q); return delim; | |
| 1990/0331/sys/src/9/gnot/stream.c:387,393 – 1990/0403/sys/src/9/gnot/stream.c:390,397 | ||
| 1990/03091 | if(q->first == 0) q->last = 0; | |
| 1990/0312 | q->len -= BLEN(bp); | |
| 1990/03091 |
| |
| 1990/0403 | q->nb--; if((q->flag&QHIWAT) && q->len < Streamhi/2 && q->nb < Streambhi){ | |
| 1990/03091 | wakeup(&q->other->next->other->r); q->flag &= ~QHIWAT; } | |
| 1990/0331/sys/src/9/gnot/stream.c:762,775 – 1990/0403/sys/src/9/gnot/stream.c:766,781 | ||
| 1990/03091 | else q->first = bp; | |
| 1990/0312 | q->len += BLEN(bp); | |
| 1990/0403 | q->nb++; | |
| 1990/0321 | delim = bp->flags & S_DELIM; | |
| 1990/0312 | while(bp->next) { bp = bp->next; q->len += BLEN(bp); | |
| 1990/0403 | q->nb++; | |
| 1990/0321 | delim |= bp->flags & S_DELIM; | |
| 1990/0312 | } | |
| 1990/03091 | q->last = bp; | |
| 1990/0321 |
| |
| 1990/0403 | if(q->len >= Streamhi || q->nb >= Streambhi){ | |
| 1990/03091 | q->flag |= QHIWAT; | |
| 1990/0321 | delim = 1; } | |
| 1990/0331/sys/src/9/gnot/stream.c:938,950 – 1990/0403/sys/src/9/gnot/stream.c:944,955 | ||
| 1990/03091 | Queue *q; q = (Queue *)arg; | |
| 1990/0403 | return !QFULL(q->next); | |
| 1990/03091 | } void flowctl(Queue *q) { | |
| 1990/0403 | sleep(&q->r, notfull, q->next); | |
| 1990/03091 | } /* | |
| 1990/0331/sys/src/9/gnot/stream.c:996,1002 – 1990/0403/sys/src/9/gnot/stream.c:1001,1007 | ||
| 1990/03091 | * `a' is global to the whole system, just create a * pointer to it and pass it on. */ | |
| 1990/0403 | FLOWCTL(q); | |
| 1990/03091 | bp = allocb(0); bp->rptr = bp->base = (uchar *)a; bp->wptr = bp->lim = (uchar *)a+n; | |
| 1990/0331/sys/src/9/gnot/stream.c:1009,1015 – 1990/0403/sys/src/9/gnot/stream.c:1014,1020 | ||
| 1990/03091 | * system buffers and pass the buffers on. */ for(rem = n; ; rem -= i) { | |
| 1990/0403 | FLOWCTL(q); | |
| 1990/03091 | bp = allocb(rem); i = bp->lim - bp->wptr; if(i >= rem){ | |