From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 23 Aug 2012 12:47:10 -0400 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=047d7b33dc304d16af04c7f19ca2 Subject: Re: [9fans] devmnt crash, fix. Topicbox-Message-UUID: af1c5ac2-ead7-11e9-9d60-3106f5b1d025 --047d7b33dc304d16af04c7f19ca2 Content-Type: text/plain; charset=UTF-8 No. It's not true that all sleeps might return spuriously (it might have been true in Unix, I can't remember). It's not true in Plan 9. On 23 August 2012 12:24, erik quanstrom wrote: > > sleep(&up->waitr, haswaitq, up); > > > > lock(&up->exl); > > wq = up->waitq; > > up->waitq = wq->next; <-- wq == nil, boom! its gone! > > up->nwait--; > > unlock(&up->exl); > > > > > > if sleep returns or is spuriously woken up even tho up->waitq == nil. > > ah, right. looks like a bug. > > - erik > > --047d7b33dc304d16af04c7f19ca2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable No. It's not true that all sleeps might return spuriously (it might hav= e been true in Unix, I can't remember).
It's not true in Plan 9= .

On 23 August 2012 12:24, erik quanstrom= <quanstro@quanstro.net> wrote:
>= =C2=A0 =C2=A0 =C2=A0 sleep(&up->waitr, haswaitq, up);
>
> =C2=A0 =C2=A0 =C2=A0 lock(&up->exl);
> =C2=A0 =C2=A0 =C2=A0 wq =3D up->waitq;
> =C2=A0 =C2=A0 =C2=A0 up->waitq =3D wq->next; =C2=A0 <-- wq = =3D=3D nil, boom! its gone!
> =C2=A0 =C2=A0 =C2=A0 up->nwait--;
> =C2=A0 =C2=A0 =C2=A0 unlock(&up->exl);
>
>
> if sleep returns or is spuriously woken up even tho up->waitq =3D= =3D nil.

ah, right. =C2=A0looks like a bug.

- erik


--047d7b33dc304d16af04c7f19ca2--