equal
deleted
inserted
replaced
37 static jlong atomic_add_jlong(jlong value, jlong volatile* const dest) { |
37 static jlong atomic_add_jlong(jlong value, jlong volatile* const dest) { |
38 assert(VM_Version::supports_cx8(), "unsupported"); |
38 assert(VM_Version::supports_cx8(), "unsupported"); |
39 jlong compare_value; |
39 jlong compare_value; |
40 jlong exchange_value; |
40 jlong exchange_value; |
41 do { |
41 do { |
42 compare_value = Atomic::load(dest); |
42 compare_value = *dest; |
43 exchange_value = compare_value + value; |
43 exchange_value = compare_value + value; |
44 } while (Atomic::cmpxchg(exchange_value, dest, compare_value) != compare_value); |
44 } while (Atomic::cmpxchg(exchange_value, dest, compare_value) != compare_value); |
45 return exchange_value; |
45 return exchange_value; |
46 } |
46 } |
47 |
47 |