src/hotspot/os/aix/os_aix.cpp
changeset 59252 623722a6aeb9
parent 59108 6f42d2a19117
child 59290 97d13893ec3c
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
  1082     jlong now = jlong(time.tb_high) * NANOSECS_PER_SEC + jlong(time.tb_low);
  1082     jlong now = jlong(time.tb_high) * NANOSECS_PER_SEC + jlong(time.tb_low);
  1083     jlong prev = max_real_time;
  1083     jlong prev = max_real_time;
  1084     if (now <= prev) {
  1084     if (now <= prev) {
  1085       return prev;   // same or retrograde time;
  1085       return prev;   // same or retrograde time;
  1086     }
  1086     }
  1087     jlong obsv = Atomic::cmpxchg(now, &max_real_time, prev);
  1087     jlong obsv = Atomic::cmpxchg(&max_real_time, prev, now);
  1088     assert(obsv >= prev, "invariant");   // Monotonicity
  1088     assert(obsv >= prev, "invariant");   // Monotonicity
  1089     // If the CAS succeeded then we're done and return "now".
  1089     // If the CAS succeeded then we're done and return "now".
  1090     // If the CAS failed and the observed value "obsv" is >= now then
  1090     // If the CAS failed and the observed value "obsv" is >= now then
  1091     // we should return "obsv".  If the CAS failed and now > obsv > prv then
  1091     // we should return "obsv".  If the CAS failed and now > obsv > prv then
  1092     // some other thread raced this thread and installed a new value, in which case
  1092     // some other thread raced this thread and installed a new value, in which case
  1792 
  1792 
  1793 static int check_pending_signals() {
  1793 static int check_pending_signals() {
  1794   for (;;) {
  1794   for (;;) {
  1795     for (int i = 0; i < NSIG + 1; i++) {
  1795     for (int i = 0; i < NSIG + 1; i++) {
  1796       jint n = pending_signals[i];
  1796       jint n = pending_signals[i];
  1797       if (n > 0 && n == Atomic::cmpxchg(n - 1, &pending_signals[i], n)) {
  1797       if (n > 0 && n == Atomic::cmpxchg(&pending_signals[i], n, n - 1)) {
  1798         return i;
  1798         return i;
  1799       }
  1799       }
  1800     }
  1800     }
  1801     JavaThread *thread = JavaThread::current();
  1801     JavaThread *thread = JavaThread::current();
  1802     ThreadBlockInVM tbivm(thread);
  1802     ThreadBlockInVM tbivm(thread);