bval-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BVAL-173) Unsafe double-checked locking
Date Mon, 22 Apr 2019 19:49:00 GMT

    [ https://issues.apache.org/jira/browse/BVAL-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16823382#comment-16823382
] 

Romain Manni-Bucau commented on BVAL-173:
-----------------------------------------

Hi John, do you have an accessible code path where it wouldnt be the case? AFAIK this code
should be safe in bval.

> Unsafe double-checked locking
> -----------------------------
>
>                 Key: BVAL-173
>                 URL: https://issues.apache.org/jira/browse/BVAL-173
>             Project: BVal
>          Issue Type: Bug
>            Reporter: John Myers
>            Priority: Major
>
> The methods org.apache.bval.util.Lazy.get() and org.apache.bval.util.LazyInt.getAsInt()
both use unsafe double-checked locking. In both cases, the fact that init is volatile does
not, under the Java Memory Model, prevent an incompletely initialized value from being returned
from the function.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message