< prev index next >

src/hotspot/os/bsd/os_bsd.cpp

Print this page

        

@@ -928,11 +928,11 @@
   const uint64_t now = (tm * Bsd::_timebase_info.numer) / Bsd::_timebase_info.denom;
   const uint64_t prev = Bsd::_max_abstime;
   if (now <= prev) {
     return prev;   // same or retrograde time;
   }
-  const uint64_t obsv = Atomic::cmpxchg(now, &Bsd::_max_abstime, prev);
+  const uint64_t obsv = Atomic::cmpxchg(&Bsd::_max_abstime, 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

@@ -1831,11 +1831,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);

@@ -3235,11 +3235,11 @@
 
     for (uint i = 0; i < max_apic_ids; ++i) {
       mapping[i] = -1;
     }
 
-    if (!Atomic::replace_if_null(mapping, &apic_to_processor_mapping)) {
+    if (!Atomic::replace_if_null(&apic_to_processor_mapping, mapping)) {
       FREE_C_HEAP_ARRAY(int, mapping);
       mapping = Atomic::load_acquire(&apic_to_processor_mapping);
     }
   }
 

@@ -3261,11 +3261,11 @@
 
   uint apic_id = edx;
   int processor_id = Atomic::load(&mapping[apic_id]);
 
   while (processor_id < 0) {
-    if (Atomic::cmpxchg(-2, &mapping[apic_id], -1)) {
+    if (Atomic::cmpxchg(&mapping[apic_id], -1, -2)) {
       Atomic::store(&mapping[apic_id], Atomic::add(&next_processor_id, 1) - 1);
     }
     processor_id = Atomic::load(&mapping[apic_id]);
   }
 
< prev index next >