6618886: Anonymous objects can be destructed immediately and so should not be used
authorxlu
Fri, 01 Aug 2008 15:18:14 -0700
changeset 982 e2a8e2e6051a
parent 981 29e21b1b7602
child 983 bd7d8f2c1e91
child 993 ef1ed5e7d732
6618886: Anonymous objects can be destructed immediately and so should not be used Reviewed-by: dholmes, kamg
hotspot/src/os/solaris/vm/osThread_solaris.cpp
--- a/hotspot/src/os/solaris/vm/osThread_solaris.cpp	Fri Aug 01 15:12:34 2008 -0700
+++ b/hotspot/src/os/solaris/vm/osThread_solaris.cpp	Fri Aug 01 15:18:14 2008 -0700
@@ -69,15 +69,15 @@
 static intptr_t compare_and_exchange_current_callback (
        intptr_t callback, intptr_t *addr, intptr_t compare_value, Mutex *sync) {
   if (VM_Version::supports_compare_and_exchange()) {
-     return Atomic::cmpxchg_ptr(callback, addr, compare_value);
+    return Atomic::cmpxchg_ptr(callback, addr, compare_value);
   } else {
-     MutexLockerEx(sync, Mutex::_no_safepoint_check_flag);
-     if (*addr == compare_value) {
-       *addr = callback;
-       return compare_value;
-     } else {
-       return callback;
-     }
+    MutexLockerEx ml(sync, Mutex::_no_safepoint_check_flag);
+    if (*addr == compare_value) {
+      *addr = callback;
+      return compare_value;
+    } else {
+      return callback;
+    }
   }
 }
 
@@ -86,7 +86,7 @@
   if (VM_Version::supports_compare_and_exchange()) {
     return Atomic::xchg_ptr(callback, addr);
   } else {
-    MutexLockerEx(sync, Mutex::_no_safepoint_check_flag);
+    MutexLockerEx ml(sync, Mutex::_no_safepoint_check_flag);
     intptr_t cb = *addr;
     *addr = callback;
     return cb;