From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25875: 26.0.50; Hang logging out of MS-Windows Date: Mon, 27 Feb 2017 22:58:03 +0200 Message-ID: <83bmtnpd0k.fsf@gnu.org> References: <83lgsuqacv.fsf@gnu.org> <83efylq7m4.fsf@gnu.org> <834lzgreqq.fsf@gnu.org> <3f07808e-ab1c-d6b5-9ea0-dfc4c6fd6fc9@cornell.edu> <8337f0rbz6.fsf@gnu.org> <83shmzprwo.fsf@gnu.org> <83fuizphp8.fsf@gnu.org> <83efyjpef6.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1488229711 12615 195.159.176.226 (27 Feb 2017 21:08:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2017 21:08:31 +0000 (UTC) Cc: 25875@debbugs.gnu.org To: Richard Copley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 27 22:08:26 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciSWv-0002jl-JS for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2017 22:08:25 +0100 Original-Received: from localhost ([::1]:56860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciSWz-0008CU-W0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2017 16:08:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciSNt-0000CS-Ep for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 15:59:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciSNq-0008W9-CV for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 15:59:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60540) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ciSNq-0008W2-8y for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 15:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ciSNp-0008Nr-WE for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 15:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Feb 2017 20:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25875 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25875-submit@debbugs.gnu.org id=B25875.148822910632184 (code B ref 25875); Mon, 27 Feb 2017 20:59:01 +0000 Original-Received: (at 25875) by debbugs.gnu.org; 27 Feb 2017 20:58:26 +0000 Original-Received: from localhost ([127.0.0.1]:58739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciSNF-0008N2-Sp for submit@debbugs.gnu.org; Mon, 27 Feb 2017 15:58:26 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciSNE-0008Mp-MI for 25875@debbugs.gnu.org; Mon, 27 Feb 2017 15:58:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciSN6-0008MO-Cr for 25875@debbugs.gnu.org; Mon, 27 Feb 2017 15:58:19 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciSN6-0008MK-9X; Mon, 27 Feb 2017 15:58:16 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2938 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ciSN5-000855-EI; Mon, 27 Feb 2017 15:58:15 -0500 In-reply-to: (message from Richard Copley on Mon, 27 Feb 2017 20:52:16 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129908 Archived-At: > From: Richard Copley > Date: Mon, 27 Feb 2017 20:52:16 +0000 > Cc: Ken Brown , 25875@debbugs.gnu.org > > Eli, you said: > > > As I understand it, this happens because when the input thread gets > > the WM_ENDSESSION message, it posts it to the main thread and goes on > > to sleep for 1000 sec, to avoid ending the Emacs process before it > > finishes orderly shutdown. But if the main thread happens to be > > inside redisplay, it could invoke one of the function that send > > messages to the input thread via SendMessage, which waits for the > > input thread to respond. So we do have a kind of deadlock. > > Posting a message and then sleeping while it's processed is odd, > isn't it? If the input thread /sent/ its message to the main thread, > then while waiting for SendMessage to return, the input thread would > automatically continue to process sent messages No, it's the main thread that calls SendMessage, to tell the input thread to draw something. And since the input thread is inside 'sleep', the SendMessage call never returns, and the main thread never gets around to checking its input queue, where there's an event bound to kill-emacs, waiting to be processed.