From 67dd0ccbee405ea5d7d1b0bbdf72a574e889c143 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sun, 21 Dec 2008 21:16:57 +0000 Subject: [PATCH] Set PTS_FINISHED before waking up any threads. Inside ptsdrv_{in,out}wakeup() we call KNOTE_LOCKED() to wake up any kevent(2) users. Because the kqueue handlers are executed synchronously, we must set PTS_FINISHED before calling ptsdrv_{in,out}wakeup(). Discovered by: nork --- sys/kern/tty_pts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c index c767daad127..49ea84c5d11 100644 --- a/sys/kern/tty_pts.c +++ b/sys/kern/tty_pts.c @@ -630,10 +630,9 @@ ptsdrv_close(struct tty *tp) struct pts_softc *psc = tty_softc(tp); /* Wake up any blocked readers/writers. */ + psc->pts_flags |= PTS_FINISHED; ptsdrv_outwakeup(tp); ptsdrv_inwakeup(tp); - - psc->pts_flags |= PTS_FINISHED; } static void