<AWT Dev> Endless loop in EventDispatchThread - proposed solution
linuxhippy at gmail.com
Wed Aug 24 03:05:21 PDT 2011
Please find the proposed fix at:
The "minimal" patch just tries to restore the behaviour when monitors were
used, trying to be low-risk.
The "full" patch does no longer rely on async exeptions (but still honors
them if they happen), and calls detachQueue unconditionally on shutdown (but
still takes care of pending events of only stopDispatch() has been called).
I didn't change AppContext.dispose(), as I think calling Thread.stop() may
be still benefitial to kill application-specific threads which don't honor
I took the liberty to do a small amount of low-risk refactoring:
- Replaced Vector with ArrayList, as it is only accessed after acquiring its
- Replaced event-queue id gerenation code with AtomicInteger
- Made waitForID volatile, as it is accessed by multiple threads.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the awt-dev