On 17/10/2018 07:12, Martin Balao wrote:
Have you tried Laurent's test case on Mac? (the version previous to my
refactorings, so we eliminate the OS layer). This bug should manifest there
too. Unfortunately, I don't have such environment to test and debug.
Yes, it is not reproduced on macos, at-least not so easy like on win/lin.
__2.__I’m not sure if I agree to your proposal of dispatching
non-SequencedEvents, from the queue. The events arriving after a particular
SequencedEvent could be dependent on this event – for example, the current
SequencedEvent could be a focus change event, and the subsequent events could
be Key events. So, as per your solution, if we dispatch them, there is a
possibility that the intended component may not receive those events.
An explanation of SequencedEvent above is correct, we need to block the thread until
another SequencedEvent will be dispatched or for some reason will be dropped. This is a
functional which allow synchronize execution between different EDT(per Appcontex). This
is a rare case, which mostly related to the "focus" functionality, because the
java can have only one focused element at a time, and we need to manage it between
different applications inside jvm. One application is webstart itself and another is the
user's application.
My understanding is that if you want hard-dependency enforcements, you have to
wrap events under SequencedEvent events. All other asynchronous events have
absolutely no guarantees. Blocking the EDT should not be done and that's the
reason why we dispatch non-SequencedEvent events in the meanwhile. Please note
that the only events that are put on hold and re-posted lated are
SequencedEvent events that, if dispatched, would violate the sequence rule.
It is still unclear what is going wrong, based on the stack trace it is clear
that a few SequencedEvent waits each other, but why the last(or first)
SequencedEvent, which should flush this queue, was not dispatched? Is it
possible that this event was dropped for some reason, like its source was
disposed, the appcontext itself was disposed, any other reasons?
--
Best regards, Sergey.