This has nothing to do with Java 8 or OSGi in general - you need to create
a memory barrier if another thread should see an update to a field.
volatile is one way of doing this and yes, therefore dynamic fields should
either use volatile or any other way like synchronized statements etc.

Carsten


2014-08-02 3:19 GMT+02:00 Alexander Klimetschek <[email protected]>:

> Hi Carsten,
>
> On 27.07.2014, at 23:30, Carsten Ziegeler (JIRA) <[email protected]> wrote:
>
> > Carsten Ziegeler created SLING-3792:
> > ---------------------------------------
> > The fields for the dynamic unary references in
> ResourceAccessSecurityTracker must be declared as volatile, otherwise
> updates to the field might be ignored
>
> I am curious, is that a new issue with Java 8 or a spurious problem?
> AFAICS from your changes across the codebase, any (osgi scr annotated)
> dynamic reference field should be volatile.
>
> Cheers,
> Alex




-- 
Carsten Ziegeler
Adobe Research Switzerland
[email protected]

Reply via email to