GNU bug report logs - #12832
24.3.50; Emacs lockup when idle

Previous Next

Packages: w32, emacs;

Reported by: Andy Moreton <andrewjmoreton <at> gmail.com>

Date: Thu, 8 Nov 2012 12:58:02 UTC

Severity: normal

Found in version 24.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andy Moreton <andrewjmoreton <at> gmail.com>
Cc: 12832 <at> debbugs.gnu.org, fni <at> missioncriticalit.com, dmoncayo <at> gmail.com
Subject: bug#12832: 24.3.50; Emacs lockup when idle
Date: Tue, 13 Nov 2012 19:04:48 +0200
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.  */





This bug report was last modified 12 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.