equal
deleted
inserted
replaced
42 static traceid atomic_inc(traceid volatile* const dest) { |
42 static traceid atomic_inc(traceid volatile* const dest) { |
43 assert(VM_Version::supports_cx8(), "invariant"); |
43 assert(VM_Version::supports_cx8(), "invariant"); |
44 traceid compare_value; |
44 traceid compare_value; |
45 traceid exchange_value; |
45 traceid exchange_value; |
46 do { |
46 do { |
47 compare_value = Atomic::load(dest); |
47 compare_value = *dest; |
48 exchange_value = compare_value + 1; |
48 exchange_value = compare_value + 1; |
49 } while (Atomic::cmpxchg(exchange_value, dest, compare_value) != compare_value); |
49 } while (Atomic::cmpxchg(exchange_value, dest, compare_value) != compare_value); |
50 return exchange_value; |
50 return exchange_value; |
51 } |
51 } |
52 |
52 |