On Thu, 28 Jan 2021 00:41:13 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

>> src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp line 2611:
>> 
>>> 2609:         Sleep(100);
>>> 2610:     }
>>> 2611: 
>> 
>> It can cause infinite looping as the message queue to get DISPOSE events is 
>> removed so if we are not getting disposed by now, we probably will not get 
>> DISPOSE event ever causing infinite loop.
>> XToolkit, LWToolkit does not have this infinite loop.
>
> My point is that this is not a test bug, so the test should not be changed.

Please take a look at the "AwtToolkit::Dispose()" method, on how much stuff 
should be done to properly shutdown the toolkit. This Dispose() method is 
executed immediately when we exit the message loop in the 
"Java_sun_awt_windows_WToolkit_eventLoop". So when the shutdown hook is 
executed we should have the message loop, then we call tk.QuitMessageLoop to 
stop it, and wait until all code in the Dispose() is executed. But since the 
IsDisposed() return false we for unknow reason hang, does it mean that the 
message loop still operates? Or we got some error during "QuitMessageLoop"?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2220

Reply via email to