< prev index next >

src/hotspot/os/bsd/os_bsd.cpp

Print this page

        

@@ -1892,11 +1892,11 @@
   if (!UseOprofile) {
     return;
   }
 
   char buf[PATH_MAX + 1];
-  int num = Atomic::add(1, &cnt);
+  int num = Atomic::add(&cnt, 1);
 
   snprintf(buf, PATH_MAX + 1, "%s/hs-vm-%d-%d",
            os::get_temp_directory(), os::current_process_id(), num);
   unlink(buf);
 

@@ -3262,11 +3262,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)) {
-      Atomic::store(&mapping[apic_id], Atomic::add(1, &next_processor_id) - 1);
+      Atomic::store(&mapping[apic_id], Atomic::add(&next_processor_id, 1) - 1);
     }
     processor_id = Atomic::load(&mapping[apic_id]);
   }
 
   return (uint)processor_id;
< prev index next >