mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8186166: Generalize Atomic::cmpxchg with templates
Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
61a9f88ca7
commit
e54adefc2f
31 changed files with 1046 additions and 518 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue