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

Incorrect doc for storeFence() in sun.misc.Unsafe

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 8
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      A DESCRIPTION OF THE PROBLEM :
      Javadoc for Unsafe.storeFence() claims that it inserts StoreLoad memory barrier, but actually it transforms to membar_release() which has no such guarantee. StoreLoad is inserted by fullFence() only.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      /**
       * Ensures lack of reordering of loads or stores before the fence
       * with stores after the fence.
       * @since 1.8
       */
      public native void storeFence();
      ACTUAL -
      /**
       * Ensures lack of reordering of stores before the fence
       * with loads or stores after the fence.
       * @since 1.8
       */
      public native void storeFence();

      URL OF FAULTY DOCUMENTATION :
      http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/sun/misc/Unsafe.java

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                martin Martin Buchholz
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: