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

volatile double access via Unsafe.cpp is not atomic

XMLWordPrintable

    • b43

        A DESCRIPTION OF THE PROBLEM :
        In hotspot/src/share/vm/prims/unsafe.cpp near line 422 the following code appears.
        I'm probably wrong - but isn't jdouble handling similar to jlong and should be " wrapped " for non-X86/non-SPARC CPUs?

        DEFINE_GETSETOOP_VOLATILE(jboolean, Boolean)
        DEFINE_GETSETOOP_VOLATILE(jbyte, Byte)
        DEFINE_GETSETOOP_VOLATILE(jshort, Short);
        DEFINE_GETSETOOP_VOLATILE(jchar, Char);
        DEFINE_GETSETOOP_VOLATILE(jint, Int);
        DEFINE_GETSETOOP_VOLATILE(jfloat, Float);
        DEFINE_GETSETOOP_VOLATILE(jdouble, Double);

        #if defined(SPARC) || defined(X86)
        // Sparc and X86 have atomic jlong (8 bytes) instructions
        DEFINE_GETSETOOP_VOLATILE(jlong, Long);
        #endif

              minqi Yumin Qi
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: