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

1991/0414/port/chan.c (diff list | history)

1991/0413/sys/src/9/port/chan.c:101,1111991/0414/sys/src/9/port/chan.c:101,113 (short | long | prev | next)
1990/0227    
void 
1991/0413    
freechan(Chan *c) 
{ 
	c->flag = CFREE; 
	lock(&chanalloc); 
	c->next = chanalloc.free; 
	chanalloc.free = c; 
	unlock(&chanalloc); 
1991/0414    
	if(decref(c) == 0){ 
		c->flag = CFREE; 
		lock(&chanalloc); 
		c->next = chanalloc.free; 
		chanalloc.free = c; 
		unlock(&chanalloc); 
	} 
1991/0413    
} 
 
void 
1991/0413/sys/src/9/port/chan.c:114,1261991/0414/sys/src/9/port/chan.c:116,130
1990/0907    
	if(c->flag & CFREE) 
		panic("close"); 
1990/0227    
	if(decref(c) == 0){ 
1991/0413    
		if(waserror()) { 
			freechan(c); 
			nexterror(); 
1991/0414    
		if(!waserror()) { 
			(*devtab[c->type].close)(c); 
			poperror(); 
1990/0227    
		} 
1991/0413    
		(*devtab[c->type].close)(c); 
		freechan(c); 
		poperror(); 
1991/0414    
		c->flag = CFREE; 
		lock(&chanalloc); 
		c->next = chanalloc.free; 
		chanalloc.free = c; 
		unlock(&chanalloc); 
1990/0227    
	} 
} 
 


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