From c0208d7b3876317719ff6357779ccc833483f11d Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 15 May 1994 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1994-05-15 --- port/segment.c | 6 +++--- port/sysproc.c | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/port/segment.c b/port/segment.c index 40f953db3282616aec4137a3bf1d41aec484adb9..5b3c46e5c6187004266e097813797c76c433d357 100644 --- a/port/segment.c +++ b/port/segment.c @@ -120,7 +120,7 @@ dupseg(Segment **seg, int segno, int share) s = seg[segno]; switch(s->type&SG_TYPE) { - case SG_TEXT: /* New segment shares pte set */ + case SG_TEXT: /* New segment shares pte set */ case SG_SHARED: case SG_PHYSICAL: case SG_SHDATA: @@ -132,7 +132,7 @@ dupseg(Segment **seg, int segno, int share) n = newseg(s->type, s->base, s->size); break; - case SG_BSS: /* Just copy on write */ + case SG_BSS: /* Just copy on write */ qlock(&s->lk); if(share && s->ref == 1) { s->type = (s->type&~SG_TYPE)|SG_SHARED; @@ -143,7 +143,7 @@ dupseg(Segment **seg, int segno, int share) n = newseg(s->type, s->base, s->size); break; - case SG_DATA: /* Copy on write plus demand load info */ + case SG_DATA: /* Copy on write plus demand load info */ if(segno == TSEG) return data2txt(s); diff --git a/port/sysproc.c b/port/sysproc.c index cb6cc607867fdadfcc8f47dd8a617826ce86f4b3..3b15926338ed8de2a889f1dd7125481d149b2d81 100644 --- a/port/sysproc.c +++ b/port/sysproc.c @@ -629,9 +629,9 @@ sysbrk_(ulong *arg) long sysrendezvous(ulong *arg) { - Proc *p, **l; - int s, tag; + int tag; ulong val; + Proc *p, **l; tag = arg[0]; l = &REND(up->pgrp, tag); @@ -642,8 +642,8 @@ sysrendezvous(ulong *arg) *l = p->rendhash; val = p->rendval; p->rendval = arg[1]; - /* Easy race avoidance */ - while(p->state != Rendezvous) + + while(p->mach != 0) ; ready(p); unlock(up->pgrp); @@ -657,12 +657,10 @@ sysrendezvous(ulong *arg) up->rendval = arg[1]; up->rendhash = *l; *l = up; - - s = splhi(); - unlock(up->pgrp); up->state = Rendezvous; + unlock(up->pgrp); + sched(); - splx(s); return up->rendval; }