< prev index next >

src/hotspot/share/runtime/objectMonitor.cpp

Print this page

        

@@ -247,11 +247,11 @@
 void ObjectMonitor::enter(TRAPS) {
   // The following code is ordered to check the most common cases first
   // and to reduce RTS->RTO cache line upgrades on SPARC and IA32 processors.
   Thread * const Self = THREAD;
 
-  void * cur = Atomic::cmpxchg((void*)Self, &_owner, (void*)NULL);
+  void * cur = Atomic::cmpxchg(Self, &_owner, (void*)NULL);
   if (cur == NULL) {
     // Either ASSERT _recursions == 0 or explicitly set _recursions = 0.
     assert(_recursions == 0, "invariant");
     assert(_owner == Self, "invariant");
     return;

@@ -404,11 +404,11 @@
 // Callers must compensate as needed.
 
 int ObjectMonitor::TryLock(Thread * Self) {
   void * own = _owner;
   if (own != NULL) return 0;
-  if (Atomic::cmpxchg((void*)Self, &_owner, (void*)NULL) == NULL) {
+  if (Atomic::cmpxchg(Self, &_owner, (void*)NULL) == NULL) {
     // Either guarantee _recursions == 0 or set _recursions = 0.
     assert(_recursions == 0, "invariant");
     assert(_owner == Self, "invariant");
     return 1;
   }

@@ -990,11 +990,11 @@
       // Only the current lock owner can manipulate the EntryList or
       // drain _cxq, so we need to reacquire the lock.  If we fail
       // to reacquire the lock the responsibility for ensuring succession
       // falls to the new owner.
       //
-      if (Atomic::cmpxchg((void*)THREAD, &_owner, (void*)NULL) != NULL) {
+      if (Atomic::cmpxchg(THREAD, &_owner, (void*)NULL) != NULL) {
         return;
       }
       TEVENT(Exit - Reacquired);
     } else {
       if ((intptr_t(_EntryList)|intptr_t(_cxq)) == 0 || _succ != NULL) {

@@ -1015,11 +1015,11 @@
         //     we either restart/rerun the exit operation, or simply
         //     fall-through into the code below which wakes a successor.
         // B.  If the elements forming the EntryList|cxq are TSM
         //     we could simply unpark() the lead thread and return
         //     without having set _succ.
-        if (Atomic::cmpxchg((void*)THREAD, &_owner, (void*)NULL) != NULL) {
+        if (Atomic::cmpxchg(THREAD, &_owner, (void*)NULL) != NULL) {
           TEVENT(Inflated exit - reacquired succeeded);
           return;
         }
         TEVENT(Inflated exit - reacquired failed);
       } else {

@@ -1978,11 +1978,11 @@
     // the spin without prejudice or apply a "penalty" to the
     // spin count-down variable "ctr", reducing it by 100, say.
 
     Thread * ox = (Thread *) _owner;
     if (ox == NULL) {
-      ox = (Thread*)Atomic::cmpxchg((void*)Self, &_owner, (void*)NULL);
+      ox = (Thread*)Atomic::cmpxchg(Self, &_owner, (void*)NULL);
       if (ox == NULL) {
         // The CAS succeeded -- this thread acquired ownership
         // Take care of some bookkeeping to exit spin state.
         if (sss && _succ == Self) {
           _succ = NULL;
< prev index next >