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

2002/0406/port/taslock.c (diff list | history)

2002/0406/sys/src/9/port/taslock.c:152,1572002/0413/sys/src/9/port/taslock.c:152,158 (short | long | prev | next)
1992/0222    
	return 1; 
} 
 
2002/0413    
int buggeredsched; 
1992/0222    
void 
unlock(Lock *l) 
{ 
2002/0406/sys/src/9/port/taslock.c:165,1752002/0413/sys/src/9/port/taslock.c:166,180
2002/0406    
	coherence(); 
 
	/* give up the processor if ... */ 
	if(up && --up->nlocks == 0	/* we've closed the last nexted lock */ 
2002/0413    
	if(up && --up->nlocks == 0	/* we've closed the last nested lock */ 
2002/0406    
	&& up->delaysched		/* we delayed scheduling because of the lock */ 
	&& up->state == Running){	/* we're in running state */ 
2002/0402    
		up->delaysched = 0; 
		sched(); 
2002/0413    
	&& up->state == Running){		/* we're in running state */ 
		if(!islo()) 
			buggeredsched++; 
		else{ 
			up->delaysched = 0; 
			sched(); 
		} 
2002/0402    
	} 
1994/0322    
} 
 


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