Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Feb 1996 22:18:55 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        babkin@hq.icb.chel.su, bde@zeta.org.au
Cc:        hackers@freebsd.org
Subject:   Re: Digi patch
Message-ID:  <199602161118.WAA07943@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>There is a fix for the bug reported to me by Alexis Yashin (sometimes
>the process hangs when closing digi port). Commit it please.

>Thank you!


>*** dgb.c	1996/02/05 04:35:28
>--- dgb.c	1996/02/05 04:40:17
>***************
>*** 1386,1391 ****
>--- 1386,1392 ----
>  				}
>  #ifndef TS_ASLEEP	/* post 2.0.5 FreeBSD */
>  				ttwwakeup(tp);
>+ 				wakeup(TSA_OCOMPLETE(tp));
>  #else
>  				if(tp->t_state & TS_ASLEEP) {
>  					tp->t_state &= ~TS_ASLEEP;

Er, it's wrong.  Processes sleeping on TSA_OCOMPLETE(tp) should not be
woken up until output is complete.  ttwwakeup() does this.  Output is
complete if t_outq is empty and the TS_BUSY bit is clear.  The bug is
probably that TS_BUSY doesn't get cleared properly.  TS_BUSY apparently
gets cleared in the next call to t_oproc() - otherwise ttywait() would
loop forever waking itself up.  The extra wakeup would be harmless if
this livelock wasn't a possibility.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602161118.WAA07943>