On Wed, 27 May 2026 19:05:11 GMT, Sergey Bylokhov <[email protected]> wrote:
>> push() is an instance method of the EQ. So some EQ has been initialized
>> before we get there. And there is locking for the push/pop.
>> And the setting of the "currentQueue", even when it was per-app context was
>> not in a synchronized block - not sure if that's what you are asking for but
>> I'm not seeing any reason to add it now.
>
> EQ is not final, so the user may have its own EQ. it should be possible to
> break it by this order:
>
> Suntoolkit->contructor->initEQ()->
> if (currentEventQueue == null) {
> currentEventQueue = new EventQueue();
> <--sleep here-->
> postEventQueue = new PostEventQueue(currentEventQueue);
> }
>
> then:
>
> EventQueue->push()->
> if (SunToolkit.currentEventQueue == topQueue) {
> SunToolkit.currentEventQueue = newEventQueue;
> }
>
> then
>
> Suntoolkit->contructor->initEQ()->
> <--wakeup here-->
> postEventQueue = new PostEventQueue(currentEventQueue);
> }
So you are (as I asked above) suggesting synchronizing that block in push() ?
It never has been synchronized before.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31262#discussion_r3313272780