plan 9 kernel history: overview | file list | diff list

1990/1011/port/devpipe.c (diff list | history)

1990/1009/sys/src/9/port/devpipe.c:201,2081990/1011/sys/src/9/port/devpipe.c:201,209 (short | long | prev | next)
1990/0227    
void 
1990/1009    
pipeexit(Pipe *p) 
{ 
	decref(p); 
	if(p->ref <= 0){ 
1990/1011    
	if(decref(p) < 0) 
		panic("pipeexit"); 
	if(p->ref == 0){ 
1990/1009    
		lock(&pipealloc); 
		p->next = pipealloc.free; 
		pipealloc.free = p; 
1990/1009/sys/src/9/port/devpipe.c:220,2371990/1011/sys/src/9/port/devpipe.c:221,232
1990/1009    
	p = &pipealloc.pipe[STREAMID(c->qid)/2]; 
1990/0629    
 
1990/1009    
	/* 
	 *  take care of assosiated streams 
1990/1011    
	 *  take care of associated streams 
1990/1009    
	 */ 
	if(local = c->stream){ 
		remote = (Stream *)c->stream->devq->ptr; 
		if(waserror()){ 
			streamexit(remote, 0); 
			pipeexit(p); 
			nexterror(); 
		} 
		streamclose(c);		/* close this stream */ 
		streamexit(remote, 0);	/* release stream for other half of pipe */ 
		poperror(); 
1990/0629    
	} 
1990/1009    
	pipeexit(p); 
1990/0227    
} 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)