~kris/9p

9hist

94cff37c0767c65886a482c5bae780cb4f8582e8 — David du Colombier 35 years ago 78567b6
Plan 9 from Bell Labs 1991-08-05
1 files changed, 13 insertions(+), 5 deletions(-)

M port/proc.c
M port/proc.c => port/proc.c +13 -5
@@ 319,6 319,10 @@ sleep(Rendez *r, int (*f)(void*), void *arg)
		sched();	/* notepending may go true while asleep */
	if(p->notepending){
		p->notepending = 0;
		lock(r);
		if(r->p == p)
			r->p = 0;
		unlock(r);
		error(Eintr);
	}
}


@@ 338,6 342,10 @@ tsleep(Rendez *r, int (*f)(void*), void *arg, int ms)
	}
	if(p->notepending){
		p->notepending = 0;
		lock(r);
		if(r->p == p)
			r->p = 0;
		unlock(r);
		error(Eintr);
	}
}


@@ 419,11 427,11 @@ postnote(Proc *p, int dolock, char *n, int flag)
		s = splhi();
		lock(r);
		if(p->r==r && r->p==p){	/* check we won the race */
			r->p = 0;
			if(p->state != Wakeme)
				panic("postnote wakeup: not Wakeme");
			p->r = 0;
			ready(p);
			if(p->state == Wakeme){
				r->p = 0;
				p->r = 0;
				ready(p);
			}
		}
		unlock(r);
		splx(s);