Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6480405

Remove sun.misc.AtomicLong

    XMLWordPrintable

Details

    • b06
    • generic
    • generic
    • Not verified

    Backports

      Description

        There's a double-read of a volatile in sun/misc/AtomicLongCSImpl.java. The double-read allows the increment function to read a value X on the first read, read Y on the 2nd read, have the value X restored before the CAS, then CAS down Y+1 over X (instead of X+1). Being synchronized doesn't help here because the set'er function is not synchronized. In any case the whole point of being the 'CS' implementation is that you do not need to synchronize.

        See suggestd fix for the code change suggested for fixing this problem.

        Attachments

          Issue Links

            Activity

              People

                martin Martin Buchholz
                mmma Marvin Ma (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: