Change 27527 by [EMAIL PROTECTED] on 2006/03/17 04:19:01
Subject: [PATCH] win32_async_check() can loop indefinitely; 5.8.8
regression
From: Jan Dubois <[EMAIL PROTECTED]>
Date: Thu, 16 Mar 2006 16:11:48 -0800
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/win32/win32.c#256 edit
Differences ...
==== //depot/perl/win32/win32.c#256 (text) ====
Index: perl/win32/win32.c
--- perl/win32/win32.c#255~27283~ 2006-02-23 06:07:13.000000000 -0800
+++ perl/win32/win32.c 2006-03-16 20:19:01.000000000 -0800
@@ -1784,8 +1784,17 @@
w32_poll_count = 0;
- if (hwnd == INVALID_HANDLE_VALUE)
+ if (hwnd == INVALID_HANDLE_VALUE) {
+ /* Call PeekMessage() to mark all pending messages in the queue as
"old".
+ * This is necessary when we are being called by win32_msgwait() to
+ * make sure MsgWaitForMultipleObjects() stops reporting the same
waiting
+ * message over and over. An example how this can happen is when
+ * Perl is calling win32_waitpid() inside a GUI application and the GUI
+ * is generating messages before the process terminated.
+ */
+ PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE|PM_NOYIELD);
return 1;
+ }
/* Passing PeekMessage -1 as HWND (2nd arg) only get PostThreadMessage()
messages
* and ignores window messages - should co-exist better with windows apps
e.g. Tk
End of Patch.