< prev index next >
src/hotspot/os/aix/os_aix.cpp
Print this page
*** 1082,1092 ****
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);
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
--- 1082,1092 ----
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(&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,1802 ****
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)) {
return i;
}
}
JavaThread *thread = JavaThread::current();
ThreadBlockInVM tbivm(thread);
--- 1792,1802 ----
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(&pending_signals[i], n, n - 1)) {
return i;
}
}
JavaThread *thread = JavaThread::current();
ThreadBlockInVM tbivm(thread);
< prev index next >