~kris/9p

9hist

ef2dff1dbae69e300b655586233c0b8d2c36676a — David du Colombier 33 years ago 3dfa2f3
Plan 9 from Bell Labs 1993-08-30
2 files changed, 4 insertions(+), 14 deletions(-)

M port/proc.c
M port/taslock.c
M port/proc.c => port/proc.c +0 -3
@@ 157,9 157,6 @@ loop:
	/* p->mach==0 only when process state is saved */
	if(p == 0 || p->mach){	
		unlock(&runhiq);
		/* keep off the bus (tuned for everest) */
		if(conf.nmach > 1)
			delay(7);
		goto loop;
	}
	if(p->rnext == 0)

M port/taslock.c => port/taslock.c +4 -11
@@ 8,19 8,12 @@
void
lock(Lock *l)
{
	int i;
	ulong pc;

	pc = getcallerpc(((uchar*)&l) - sizeof(l));

	for(i = 0; i < 20000000; i++){
    		if (tas(&l->key) == 0){
			l->pc = pc;
	for(;;){
		while(l->key)
			;
		if(tas(&l->key) == 0)
			return;
		}
	}
	panic("lock loop 0x%lux key 0x%lux pc 0x%lux held by pc 0x%lux\n",
			i, l->key, pc, l->pc);
}

int