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

1990/0321/gnot/stream.c (diff list | history)

1990/0321/sys/src/9/gnot/stream.c:109,1171990/0322/sys/src/9/gnot/stream.c:109,116 (short | long | prev | next)
1990/03091    
{ 
	Block *bp; 
	Bclass *bcp; 
	int i; 
1990/0322    
	int loop=0; 
1990/03091    
 
                 
	/* 
	 *  map size to class 
	 */ 
1990/0321/sys/src/9/gnot/stream.c:124,1321990/0322/sys/src/9/gnot/stream.c:123,132
1990/03091    
	lock(bcp); 
	while(bcp->first == 0){ 
		unlock(bcp); 
		print("waiting for blocks\n"); 
1990/0322    
		if(loop++ > 10) 
			panic("waiting for blocks\n"); 
1990/0312    
		qlock(bcp); 
1990/03091    
		sleep(&bcp->r, isblock, (void *)bcp); 
1990/0322    
		tsleep(&bcp->r, isblock, (void *)bcp, 250); 
1990/0312    
		qunlock(bcp); 
1990/03091    
		lock(bcp); 
	} 


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