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

1993/0528/port/taslock.c (diff list | history)

1993/0528/sys/src/9/port/taslock.c:8,261993/0830/sys/src/9/port/taslock.c:8,19 (short | long | prev | next)
1992/0222    
void 
lock(Lock *l) 
{ 
	int i; 
	ulong pc; 
                 
	pc = getcallerpc(((uchar*)&l) - sizeof(l)); 
1992/0914    
                 
1993/0528    
	for(i = 0; i < 20000000; i++){ 
1992/0914    
    		if (tas(&l->key) == 0){ 
			l->pc = pc; 
1993/0830    
	for(;;){ 
		while(l->key) 
			; 
		if(tas(&l->key) == 0) 
1992/0222    
			return; 
		} 
	} 
1992/0914    
	panic("lock loop 0x%lux key 0x%lux pc 0x%lux held by pc 0x%lux\n", 
1993/0525    
			i, l->key, pc, l->pc); 
1992/0222    
} 
 
int 


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