[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25875: 26.0.50; Hang logging out of MS-Windows
From: |
Richard Copley |
Subject: |
bug#25875: 26.0.50; Hang logging out of MS-Windows |
Date: |
Mon, 27 Feb 2017 08:14:22 +0000 |
On 26 February 2017 at 23:38, Ken Brown <kbrown@cornell.edu> wrote:
> On 2/26/2017 2:25 PM, Eli Zaretskii wrote:
>>>
>>> Cc: rcopley@gmail.com, 25875@debbugs.gnu.org
>>> From: Ken Brown <kbrown@cornell.edu>
>>> Date: Sun, 26 Feb 2017 13:58:23 -0500
>>>
>>>> I think the problem in this particular scenario is not that the input
>>>> thread sleeps too long, it's that whenever it finishes sleeping and
>>>> returns, Emacs will be killed, so the WM_ENDSESSION message that was
>>>> posted to the main thread will never have a chance to be processed,
>>>> and thus orderly shutdown will never happen.
>>>>
>>>> That is why I thought about using SendMessageTimeout in the main
>>>> thread: what we really want is to cause the main thread to wake up and
>>>> process the WM_ENDSESSION message. Right?
>>>
>>>
>>> Yes, that would obviously be better.
>>
>>
>> OK. Can you propose a patch that Richard could try?
>
>
> Here's a quick and dirty attempt. If I haven't made a mistake, it replaces
> every relevant call to SendMessage by a call to SendMessageTimeout with a
> 100ms timeout.
>
> --- a/src/w32term.c
> +++ b/src/w32term.c
> @@ -537,6 +537,15 @@ x_update_begin (struct frame *f)
> }
>
>
> +#undef SendMessage
> +#define SendMessage DebugSendMessage
> +
> +static LRESULT WINAPI
> +DebugSendMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
> +{
> + return SendMessageTimeoutA (hWnd, Msg, wParam, lParam, 0, 100, NULL);
> +}
> +
> /* Start update of window W. */
>
> static void
>
> Ken
Sorry Ken, I can't sabotage myself like that, I have work to do.
- bug#25875: 26.0.50; Hang logging out of MS-Windows, (continued)
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Eli Zaretskii, 2017/02/26
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Ken Brown, 2017/02/26
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Eli Zaretskii, 2017/02/26
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Ken Brown, 2017/02/26
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Eli Zaretskii, 2017/02/26
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Ken Brown, 2017/02/26
- bug#25875: 26.0.50; Hang logging out of MS-Windows,
Richard Copley <=
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Eli Zaretskii, 2017/02/27
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Richard Copley, 2017/02/27
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Eli Zaretskii, 2017/02/27
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Richard Copley, 2017/02/27
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Richard Copley, 2017/02/27
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Ken Brown, 2017/02/27
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Richard Copley, 2017/02/27
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Richard Copley, 2017/02/27
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Ken Brown, 2017/02/27
- bug#25875: 26.0.50; Hang logging out of MS-Windows, Eli Zaretskii, 2017/02/27