If you want to allow different threads to access it you need to: a) make the variable volatile b) add a synchronized block
Tom On 27.05.19 13:58, Mickael Istria wrote: > Hi all, > > I'm currently working on the topic of moving work out of UI Thread, > using JDT as main target (bug 538656). > In my investigations, I've hit the case of calling > `StyledText.getBlockSelection()` sending a InvalidThreadAccess because > first line of the method is `checkWidget()`. > However, this method is mostly a boolean accessor, the state of block > selection or not is purely inside the Java logic, no JNI. Invoking this > method from a thread is definitely a harmless operation > So I'm wondering: why is SWT putting so much `checkWidget()` even on > simple accessors? Is this something we could get rid of? > > Thanks in advance for your insights. > > -- > Mickael Istria > Eclipse IDE <https://www.eclipse.org/downloads/eclipse-packages/> > developer, for Red Hat Developers <https://developers.redhat.com/> > > _______________________________________________ > platform-dev mailing list > platform-dev@eclipse.org > To change your delivery options, retrieve your password, or unsubscribe from > this list, visit > https://www.eclipse.org/mailman/listinfo/platform-dev > -- Tom Schindl, CTO BestSolution.at EDV Systemhaus GmbH Eduard-Bodem-Gasse 5-7. A-6020 Innsbruck Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck _______________________________________________ platform-dev mailing list platform-dev@eclipse.org To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/platform-dev