| plan 9 kernel history: overview | file list | diff list |
1990/0621/gnot/stream.c (diff list | history)
| 1990/0620/sys/src/9/gnot/stream.c:531,538 – 1990/0621/sys/src/9/gnot/stream.c:531,542 (short | long | prev | next) | ||
| 1990/03091 | void nullput(Queue *q, Block *bp) { | |
| 1990/0621 | if(bp->type == M_HANGUP) freeb(bp); else { freeb(bp); error(0, Ehungup); } | |
| 1990/03091 | } /* | |
| 1990/0620/sys/src/9/gnot/stream.c:757,777 – 1990/0621/sys/src/9/gnot/stream.c:761,777 | ||
| 1990/0620 | if(!locked) lock(s); | |
| 1990/0621 | if(s->inuse == 1){ /* * ascend the stream freeing the queues */ for(q = s->devq; q; q = nq){ nq = q->next; freeq(q); } s->id = s->dev = s->type = 0; | |
| 1990/0620 | } | |
| 1990/0621 | s->inuse--; | |
| 1990/0620 | if(!locked) unlock(s); } | |
| 1990/0620/sys/src/9/gnot/stream.c:797,825 – 1990/0621/sys/src/9/gnot/stream.c:797,823 | ||
| 1990/0620 | * decrement the reference count | |
| 1990/03091 | */ lock(s); | |
| 1990/0620 |
| |
| 1990/03091 |
| |
| 1990/0621 | if(s->opens == 1){ /* * descend the stream closing the queues */ for(q = s->procq; q; q = q->next){ if(q->info->close) (*q->info->close)(q->other); /* this may be 2 streams joined device end to device end */ if(q == s->devq->other) break; } /* * ascend the stream flushing the queues */ for(q = s->devq; q; q = nq){ nq = q->next; flushq(q); } | |
| 1990/03091 | } | |
| 1990/0620 | ||
| 1990/03091 |
| |
| 1990/0620 |
| |
| 1990/03091 |
| |
| 1990/0620 |
| |
| 1990/03091 |
| |
| 1990/0621 | s->opens--; | |
| 1990/0620 | /* * leave it and free it | |