< prev index next >
src/share/vm/runtime/atomic.hpp
Print this page
rev 7555 : Improved metaprogramming
@@ -24,15 +24,46 @@
#ifndef SHARE_VM_RUNTIME_ATOMIC_HPP
#define SHARE_VM_RUNTIME_ATOMIC_HPP
#include "memory/allocation.hpp"
+#include "utilities/traits/selectBaseClass.hpp"
-class Atomic : AllStatic {
- private:
+class AtomicPlatform;
+
+class AtomicBase : AllStatic {
+ protected:
static jbyte cmpxchg_general(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value);
+ public:
+ inline static jbyte cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) {
+ return cmpxchg_general(exchange_value, dest, compare_value);
+ }
+};
+
+// Linux
+#ifdef TARGET_OS_ARCH_linux_x86
+# include "atomic_linux_x86.hpp"
+#endif
+
+// Solaris
+#ifdef TARGET_OS_ARCH_solaris_x86
+# include "atomic_solaris_x86.hpp"
+#endif
+
+// Windows
+#ifdef TARGET_OS_ARCH_windows_x86
+# include "atomic_windows_x86.hpp"
+#endif
+
+// BSD
+#ifdef TARGET_OS_ARCH_bsd_x86
+# include "atomic_bsd_x86.hpp"
+#endif
+
+typedef SelectBaseClass<AtomicPlatform, AtomicBase>::type AtomicSuper;
+class Atomic : public AtomicSuper {
public:
// Atomic operations on jlong types are not available on all 32-bit
// platforms. If atomic ops on jlongs are defined here they must only
// be used from code that verifies they are available at runtime and
// can provide an alternative action if not - see supports_cx8() for
< prev index next >