RFR: JMC-6555 Convert JOverflow plugin to SWT
Arvin Kangcheng Xu
kxu at redhat.com
Mon Aug 26 15:16:40 UTC 2019
(Replying all. Sorry if you've seen this reply, Mario.)
I'm unsure if those calls are queued or executed right away. I
remembered introducing this guard after I observed multiple updates
caused by single user interaction. However, I took a further look at
the code and experiment a bit. The guard is indeed unnecessary, at
least for the current code.
mIsUpdatingModel and all its usages will be removed.
On Mon, 26 Aug 2019 at 09:59, Mario Torre <neugens at redhat.com> wrote:
>
> On Mon, Aug 26, 2019 at 3:56 PM Arvin Kangcheng Xu <kxu at redhat.com> wrote:
>
> > While updateModel() is not accessed outside the thread, it's possible
> > to be called multiple times, before the previous calls finish, from
> > the SWT event thread. From what I understand, SWT operates on some
> > kind of event loop design. In the process of updating the UI, it's
> > possible for some SWT listeners to be invoked and call updateModel()
> > again. (eg. SelectionListener listener is called when the table
> > content is updated.) Without this mIsUpdatingModel, it can easily
> > result in an endless recursion. However, I do agree that guarding with
> > a boolean is not the most elegant solution. Please let me know if
> > there is a better approach coming across your mind.
>
> But if the call is synchronous those calls would be queued, not? What
> you described seems to imply a multi-thread call.
>
> Cheers,
> Mario
>
> --
> Mario Torre
> Associate Manager, Software Engineering
> Red Hat GmbH <https://www.redhat.com>
> 9704 A60C B4BE A8B8 0F30 9205 5D7E 4952 3F65 7898
More information about the jmc-dev
mailing list