Skip to content

update double checked locking impl #12207

Open
@adriaanm

Description

@adriaanm
Contributor
def mkSynchronizedCheck(clazz: Symbol, cond: Tree, syncBody: List[Tree], stats: List[Tree]): Tree

is based on http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html,
but now we're on java 8 we should revisit and consult https://shipilev.net/blog/2014/safe-public-construction to make sure we're using the best variant

Should do this for both lazy vals/modules of classes and local ones.

Activity

transferred this issue fromscala/scala-devon Oct 22, 2020
added this to the Backlog milestone on Oct 22, 2020
dwijnand

dwijnand commented on Oct 22, 2020

@dwijnand
Member

Looking at scala/scala@d9974be it looks almost like part of the impl was changed to follow shipilev's guidance while the other was left as a TODO?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @adriaanm@dwijnand

        Issue actions

          update double checked locking impl · Issue #12207 · scala/bug