From owner-svn-src-all@FreeBSD.ORG Sun Dec 21 21:16:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74F691065674; Sun, 21 Dec 2008 21:16:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6500A8FC08; Sun, 21 Dec 2008 21:16:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBLLGvXk042567; Sun, 21 Dec 2008 21:16:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBLLGvPj042566; Sun, 21 Dec 2008 21:16:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200812212116.mBLLGvPj042566@svn.freebsd.org> From: Ed Schouten Date: Sun, 21 Dec 2008 21:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186382 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Dec 2008 21:16:57 -0000 Author: ed Date: Sun Dec 21 21:16:57 2008 New Revision: 186382 URL: http://svn.freebsd.org/changeset/base/186382 Log: 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 Modified: head/sys/kern/tty_pts.c Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Sun Dec 21 20:30:14 2008 (r186381) +++ head/sys/kern/tty_pts.c Sun Dec 21 21:16:57 2008 (r186382) @@ -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