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

1990/0509/port/sturp.c (diff list | history)

1990/0505/sys/src/9/port/sturp.c:166,1721990/0509/sys/src/9/port/sturp.c:166,172 (short | long | prev | next)
1990/0227    
	Urp *up; 
 
	up = (Urp *)a; 
1990/0312    
	return (up->state&HUNGUP) || (up->unechoed==up->next && up->wq->len==0); 
1990/0509    
	return (up->state&HUNGUP) || (up->unechoed==up->nxb && up->wq->len==0); 
1990/0227    
} 
1990/0312    
static int 
isdead(void *a) 
1990/0505/sys/src/9/port/sturp.c:188,2121990/0509/sys/src/9/port/sturp.c:188,223
1990/0227    
	/* 
1990/0312    
	 *  wait for all outstanding messages to drain, tell kernel 
	 *  process we're closing. 
1990/0509    
	 * 
	 *  if 2 minutes elapse, give it up 
1990/0227    
	 */ 
1990/0312    
	up->state |= CLOSING; 
1990/0505    
	tsleep(&up->r, isflushed, up, 60*1000); 
1990/0509    
	tsleep(&up->r, isflushed, up, 2*60*1000); 
1990/0312    
 
	/* 
	 *  ack all outstanding messages 
1990/0509    
	 *  kill off the kernel process 
1990/0312    
	 */ 
	qlock(&up->xmit); 
	up->state |= HUNGUP; 
1990/0509    
	wakeup(&up->rq->r); 
 
	qlock(&up->xmit); 
	/* 
	 *  ack all outstanding messages 
	 */ 
1990/0312    
	i = up->next - 1; 
	if(i < 0) 
		i = 7; 
	rcvack(up, ECHO+i); 
	qunlock(&up->xmit); 
 
	/* 
	 *  kill off the kernel process 
1990/0509    
	 *  free all staged but unsent messages 
1990/0312    
	 */ 
	wakeup(&up->rq->r); 
1990/0509    
	for(i = 0; i < 7; i++) 
		if(up->xb[i]){ 
			freeb(up->xb[i]); 
			up->xb[i] = 0; 
		} 
	qunlock(&up->xmit); 
1990/0403    
 
	if(up->kstarted == 0) 
		up->state = 0; 


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