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

1994/0808/port/taslock.c (diff list | history)

1994/0805/sys/src/9/port/taslock.c:8,261994/0808/sys/src/9/port/taslock.c:8,19 (short | long | prev | next)
1992/0222    
void 
lock(Lock *l) 
{ 
1994/0805    
	int loop; 
                 
1993/1204    
	if(tas(&l->key) == 0) 
		return; 
1994/0322    
 
1994/0805    
	loop = 50000000; 
1993/0830    
	for(;;){ 
1994/0805    
		while(l->key) { 
			if(loop-- <= 0) { 
				dumpstack(); 
				panic("lock loop: lock %lux\n", l); 
			} 
		} 
1994/0808    
		while(l->key) 
			; 
1993/0830    
		if(tas(&l->key) == 0) 
1992/0222    
			return; 
	} 


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