src/hotspot/os_cpu/solaris_sparc/atomic_solaris_sparc.hpp
changeset 59249 29b0d0b61615
parent 53244 9807daeb47c4
child 59251 4cbfa5077d68
equal deleted inserted replaced
59248:e92153ed8bdc 59249:29b0d0b61615
    28 // Implementation of class atomic
    28 // Implementation of class atomic
    29 
    29 
    30 // Implement ADD using a CAS loop.
    30 // Implement ADD using a CAS loop.
    31 template<size_t byte_size>
    31 template<size_t byte_size>
    32 struct Atomic::PlatformAdd {
    32 struct Atomic::PlatformAdd {
    33   template<typename I, typename D>
    33   template<typename D, typename I>
    34   inline D operator()(I add_value, D volatile* dest, atomic_memory_order order) const {
    34   inline D operator()(D volatile* dest, I add_value, atomic_memory_order order) const {
    35     D old_value = *dest;
    35     D old_value = *dest;
    36     while (true) {
    36     while (true) {
    37       D new_value = old_value + add_value;
    37       D new_value = old_value + add_value;
    38       D result = cmpxchg(new_value, dest, old_value);
    38       D result = cmpxchg(new_value, dest, old_value);
    39       if (result == old_value) break;
    39       if (result == old_value) break;