<AWT Dev> Endless loop in EventDispatchThread - proposed solution
linuxhippy at gmail.com
Thu Aug 25 15:58:32 PDT 2011
Yes I understand why you added the check. I'm not sure what you mean about
> hiding the InterruptedException though. As I understood the scenario the
> interrupt() breaks the thread out of await() by throwing IE, which is then
> caught at a higher-level (not sure exactly where), but because of further
> pending events the IE does not cause the EDT to detach/terminate but instead
> it continues to process events eventually calling await() again. Then the
> stop() gets issued which causes the await() to abort by throwing
> ThreadDeath, without reclaiming the Lock, and so the unlock in the finally
> clause throws IllegalMonitorStateException.
Sorry, misunderstanding on my side. I thought when interrupting the thread,
re-claiming the lock would also fail, but it doesn't. Your analysis is
totally correct. So the "full" patch could probably do without the checks,
as it should not run into this condition (even when a ThreadDeath is covered
by IllegalMonitorException, shutodown=true -> no more calls of await()).
However, it doesn't hurt a lot on the other side. What do you think?
I'm no AWT expert either, it just concerns me when there is an introduced
> change in behaviour without a full understanding of the implications. We
> really need some input from an AWT event processing guru.
Thanks again, Clemens
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the awt-dev