< prev index next >
src/hotspot/os/aix/os_aix.cpp
Print this page
@@ -1082,11 +1082,11 @@
jlong now = jlong(time.tb_high) * NANOSECS_PER_SEC + jlong(time.tb_low);
jlong prev = max_real_time;
if (now <= prev) {
return prev; // same or retrograde time;
}
- jlong obsv = Atomic::cmpxchg(now, &max_real_time, prev);
+ jlong obsv = Atomic::cmpxchg(&max_real_time, prev, now);
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
// we should return "obsv". If the CAS failed and now > obsv > prv then
// some other thread raced this thread and installed a new value, in which case
@@ -1792,11 +1792,11 @@
static int check_pending_signals() {
for (;;) {
for (int i = 0; i < NSIG + 1; i++) {
jint n = pending_signals[i];
- if (n > 0 && n == Atomic::cmpxchg(n - 1, &pending_signals[i], n)) {
+ if (n > 0 && n == Atomic::cmpxchg(&pending_signals[i], n, n - 1)) {
return i;
}
}
JavaThread *thread = JavaThread::current();
ThreadBlockInVM tbivm(thread);
< prev index next >