< prev index next >

src/share/vm/runtime/atomic.hpp

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_ATOMIC_HPP
  26 #define SHARE_VM_RUNTIME_ATOMIC_HPP
  27 
  28 #include "memory/allocation.hpp"

  29 #include "utilities/macros.hpp"
  30 
  31 enum cmpxchg_memory_order {
  32   memory_order_relaxed,
  33   // Use value which doesn't interfere with C++2011. We need to be more conservative.
  34   memory_order_conservative = 8
  35 };
  36 
  37 class Atomic : AllStatic {
  38  public:
  39   // Atomic operations on jlong types are not available on all 32-bit
  40   // platforms. If atomic ops on jlongs are defined here they must only
  41   // be used from code that verifies they are available at runtime and
  42   // can provide an alternative action if not - see supports_cx8() for
  43   // a means to test availability.
  44 
  45   // The memory operations that are mentioned with each of the atomic
  46   // function families come from src/share/vm/runtime/orderAccess.hpp,
  47   // e.g., <fence> is described in that file and is implemented by the
  48   // OrderAccess::fence() function. See that file for the gory details




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_ATOMIC_HPP
  26 #define SHARE_VM_RUNTIME_ATOMIC_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "utilities/align.hpp"
  30 #include "utilities/macros.hpp"
  31 
  32 enum cmpxchg_memory_order {
  33   memory_order_relaxed,
  34   // Use value which doesn't interfere with C++2011. We need to be more conservative.
  35   memory_order_conservative = 8
  36 };
  37 
  38 class Atomic : AllStatic {
  39  public:
  40   // Atomic operations on jlong types are not available on all 32-bit
  41   // platforms. If atomic ops on jlongs are defined here they must only
  42   // be used from code that verifies they are available at runtime and
  43   // can provide an alternative action if not - see supports_cx8() for
  44   // a means to test availability.
  45 
  46   // The memory operations that are mentioned with each of the atomic
  47   // function families come from src/share/vm/runtime/orderAccess.hpp,
  48   // e.g., <fence> is described in that file and is implemented by the
  49   // OrderAccess::fence() function. See that file for the gory details


< prev index next >