You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Richard Zowalla (Jira)" <ji...@apache.org> on 2023/05/17 18:53:00 UTC

[jira] [Resolved] (TOMEE-1934) Incorrect double-check locking

     [ https://issues.apache.org/jira/browse/TOMEE-1934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Zowalla resolved TOMEE-1934.
------------------------------------
    Resolution: Auto Closed

Hi there!

We wanted to reach out and let you know that we're currently working on cleaning up open issues in Jira that specifically impact unsupported versions, including 1.7.x, 7.0.x, and 7.1.x.

If you had previously reported this issue on one of these unsupported versions, we kindly ask you to check if the problem still persists and can be reproduced on a supported version such as 8.0.x or 9.0.x. If you find that it is indeed reproducible on a supported version, you're more than welcome to re-open this issue.

Thanks!


> Incorrect double-check locking
> ------------------------------
>
>                 Key: TOMEE-1934
>                 URL: https://issues.apache.org/jira/browse/TOMEE-1934
>             Project: TomEE
>          Issue Type: Bug
>            Reporter: Svetlin Zarev
>            Priority: Trivial
>
> http://www.cs.umd.edu/%7Epugh/java/memoryModel/DoubleCheckedLocking.html
> {code}
>  public BeanManagerImpl getBeanManagerImpl() {
>         if (bm == null) { // should be done in the constructor
>             synchronized (this) {
>                 if (bm == null) {
>                     bm = new WebappBeanManager(this);
>                 }
>             }
>         }
>         return bm;
>     }
> {code}
> Unless **bm** is volatile, multiple instances of the bean manager can be created under concurrent conditions. 
> PS: I saw the suppress warning. I'm not sure if PMD just warns against DCL or that it was broken. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)