<AWT Dev>  Review request for 7186109: Simplify lock machinery for PostEventQueue & EventQueue
oleg.pekhovskiy at oracle.com
Tue Aug 28 07:33:14 PDT 2012
Hi Artem, Anthony,
thank you for your proposals!
We with Artem also had off-line discussion,
so as a result I prepared improved version of fix:
What was done:
1. EventQueue.detachDispatchThread(): moved
SunToolkit.flushPnedingEvents() above the comments and added a separate
comment to it.
2. Moved SunToolkitSubclass.flushPendingEvents(AppContext) method to
SunToolkit. Deleted SunToolkitSubclass.
3. Moved isFlushingPendingEvents to PostEventQueue with the new name -
isThreadLocalFlushing and made it ThreadLocal.
4. Left PostEventQueue.flush() unsynchronized and created
wait()-notifyAll() synchronization mechanism to avoid blocking of
Looking forward to your comments!
20.08.2012 20:20, Artem Ananiev wrote:
> Hi, Oleg,
> here are a few comments:
> 1. What is the reason of keeping "isFlushingPendingEvents" in
> SunToolkit, given that PEQ.flush() is synchronized (and therefore
> serialized) anyway?
> 2. flushPendingEvents(AppContext) may be moved directly to SunToolkit,
> so we don't need a separate sun-class for that.
> 3. EQ.java:1035-1040 - this comment is obsolete and must be replaced
> by another one.
> On 8/17/2012 4:49 PM, Oleg Pekhovskiy wrote:
>> Please review the fix for CR:
>> The following changes were made:
>> 1. Removed flushLock from SunToolkit.flushPendingEvent()
>> 2. Returned method PostEventQueue.flush() as 'synchronized' back
>> 3. Added call of SunToolkit.flushPendingEvents() to
>> right before pushPopLock.lock()
>> 4. Removed !SunToolkit.isPostEventQueueEmpty() check from
>> 5. Removed SunToolkit.isPostEventQueueEmpty() &
More information about the awt-dev