From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12832: 24.3.50; Emacs lockup when idle Date: Tue, 13 Nov 2012 19:04:48 +0200 Message-ID: <83ehjxv3gv.fsf@gnu.org> References: <838vac12kn.fsf@gnu.org> <509BFAE7.8020205@gmail.com> <83liebyu9t.fsf@gnu.org> <509CDF7F.2000409@gmail.com> <83ip9fyqmy.fsf@gnu.org> <83390izlxm.fsf@gnu.org> <509D4DAC.1060901@gmail.com> <83pq3hvet0.fsf@gnu.org> <509BAC2E.2000702@gmail.com> <80r4nxsl1s.fsf@somewhere.org> <83lie5vbot.fsf@gnu.org> <50A2585A.3050008@gmail.com> <83ip99v8h5.fsf@gnu.org> <50A26E9E.4020405@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1352826340 25912 80.91.229.3 (13 Nov 2012 17:05:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Nov 2012 17:05:40 +0000 (UTC) Cc: fni@missioncriticalit.com, 12832@debbugs.gnu.org To: Andy Moreton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 13 18:05:50 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TYJvp-000633-Cu for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Nov 2012 18:05:49 +0100 Original-Received: from localhost ([::1]:59926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYJvf-0006h8-OB for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Nov 2012 12:05:39 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYJvb-0006fj-5P for bug-gnu-emacs@gnu.org; Tue, 13 Nov 2012 12:05:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYJvY-0005Uy-3i for bug-gnu-emacs@gnu.org; Tue, 13 Nov 2012 12:05:35 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYJvY-0005Us-0W for bug-gnu-emacs@gnu.org; Tue, 13 Nov 2012 12:05:32 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TYJw2-0002Qf-9r for bug-gnu-emacs@gnu.org; Tue, 13 Nov 2012 12:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Nov 2012 17:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12832 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Original-Received: via spool by 12832-submit@debbugs.gnu.org id=B12832.13528263069242 (code B ref 12832); Tue, 13 Nov 2012 17:06:02 +0000 Original-Received: (at 12832) by debbugs.gnu.org; 13 Nov 2012 17:05:06 +0000 Original-Received: from localhost ([127.0.0.1]:39013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TYJv7-0002P1-RT for submit@debbugs.gnu.org; Tue, 13 Nov 2012 12:05:06 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:60499) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TYJv5-0002Oq-2Q for 12832@debbugs.gnu.org; Tue, 13 Nov 2012 12:05:03 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MDF00F00RBA4300@a-mtaout22.012.net.il> for 12832@debbugs.gnu.org; Tue, 13 Nov 2012 19:04:30 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MDF00ENFRFIK890@a-mtaout22.012.net.il>; Tue, 13 Nov 2012 19:04:30 +0200 (IST) In-reply-to: <50A26E9E.4020405@gmail.com> X-012-Sender: halo1@inter.net.il X-Spam-Score: 1.5 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: 1.5 (+) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66881 Archived-At: Can you please try the patch below and see if it prevents the lock-ups? === modified file 'src/w32proc.c' --- src/w32proc.c 2012-11-05 03:18:32 +0000 +++ src/w32proc.c 2012-11-13 16:59:53 +0000 @@ -431,13 +431,24 @@ timer_loop (LPVOID arg) /* Simulate a signal delivered to the thread which installed the timer, by suspending that thread while the handler runs. */ - DWORD result = SuspendThread (itimer->caller_thread); + DWORD result; + + if (dwMainThreadId) + enter_crit (); + result = SuspendThread (itimer->caller_thread); if (result == (DWORD)-1) - return 2; + { + if (dwMainThreadId) + leave_crit (); + return 2; + } handler (sig); ResumeThread (itimer->caller_thread); + + if (dwMainThreadId) + leave_crit (); } /* Update expiration time and loop. */