8186166: Generalize Atomic::cmpxchg with templates

Reviewed-by: dholmes, coleenp
This commit is contained in:
Kim Barrett 2017-08-23 14:01:17 +02:00 committed by Erik Österlund
parent 61a9f88ca7
commit e54adefc2f
31 changed files with 1046 additions and 518 deletions

View file

@ -1197,7 +1197,7 @@ inline hrtime_t getTimeNanos() {
if (now <= prev) {
return prev; // same or retrograde time;
}
const hrtime_t obsv = Atomic::cmpxchg(now, (volatile jlong*)&max_hrtime, prev);
const hrtime_t obsv = Atomic::cmpxchg(now, &max_hrtime, prev);
assert(obsv >= prev, "invariant"); // Monotonicity
// If the CAS succeeded then we're done and return "now".
// If the CAS failed and the observed value "obsv" is >= now then