<AWT Dev> [7u10] Review request for 7188708 - REGRESSION: closed/java/awt/EventQueue/PostEventOrderingTest.java fails
oleg.pekhovskiy at oracle.com
Fri Sep 7 05:38:08 PDT 2012
I'll leave "isFlushingPendingEvents" flag as David proposed.
9/7/2012 4:37 PM, Artem Ananiev wrote:
> Hi, Oleg,
> shouldn't flushLock.unlock() be protected with
> if (--flushNestingLevel == 0)
> On 9/7/2012 5:57 AM, Oleg Pekhovskiy wrote:
>> Please review the fix for CR:
>> The reason is that isFlushingPendingEvents in
>> SunToolkit.flushPendingEvents() is reset
>> after the first recursive call of flushPendingEvents(). Thus, if there
>> are several pending events in PostEventQueue,
>> recursion would be rejected only for the first event, allowing nested
>> call of PostEventQueue.flush() after.
>> To resolve the problem I added the counter "flushNestingLevel" instead
>> of the flag "isFlushingPendingEvents".
>> It's increased each time entering SunToolkit.flushPendingEvents() and
>> decreased on exit.
>> So, PostEventQueue.flush() method is called only when we enter
>> SunToolkit.flushPendingEvents() for the first time
>> within one thread.
>> That fix was prepared ONLY for 7u10.
>> For JDK 8 the fix for "CR7186109 - Simplify lock machinery for
>> PostEventQueue & EventQueue" should cover this case.
More information about the awt-dev