Subject: bug#12832: 24.3.50; Emacs lockup when idle

From: Eli Zaretskii <[email-masked]>
Date: Wed, 14 Nov 2012 18:51:44 +0200

> Date: Wed, 14 Nov 2012 16:29:53 +0000
> From: Andy Moreton <[email-masked]>
> CC: [email-masked], [email-masked], [email-masked]
> 
> After longer uptime, it seems this patch is not successful. I haven't had a 
> complete lockup, but I have seen a couple of glitches where it froze but then 
> recovered a short while later.

OK, that was a stab in the dark anyway.

I found a few problems in the code and fixed them in revision 110867
on the emacs-24 branch.  Please try the latest branch (without the
patch) and see if the problem persists.

> The patched emacs-24 does seem to leak handles: at the moment Process Explorer 
> report that emacs has 50805 handles in all, most of which are thread handles. 
> The number of handles seems to increase at a rate of 2 to 4 per second.

Yes, that's one of the problems I fixed in r110867.  Shame on me.

(I think the fact that the handle to the caller thread was constantly
modified could be the reason for the lockup, if the change happened
between SuspendThread and ResumeThread calls.)