src/hotspot/share/runtime/mutex.cpp
changeset 54495 941db9c0b5b5
parent 53775 5d20b085d893
child 54623 1126f0607c70
equal deleted inserted replaced
54494:1bbce3048d20 54495:941db9c0b5b5
   157   // as_suspend_equivalent logically implies !no_safepoint_check
   157   // as_suspend_equivalent logically implies !no_safepoint_check
   158   guarantee(!as_suspend_equivalent || !no_safepoint_check, "invariant");
   158   guarantee(!as_suspend_equivalent || !no_safepoint_check, "invariant");
   159   // !no_safepoint_check logically implies java_thread
   159   // !no_safepoint_check logically implies java_thread
   160   guarantee(no_safepoint_check || self->is_Java_thread(), "invariant");
   160   guarantee(no_safepoint_check || self->is_Java_thread(), "invariant");
   161 
   161 
   162   #ifdef ASSERT
   162 #ifdef ASSERT
   163   Monitor * least = get_least_ranked_lock_besides_this(self->owned_locks());
   163   Monitor * least = get_least_ranked_lock_besides_this(self->owned_locks());
   164   assert(least != this, "Specification of get_least_... call above");
   164   assert(least != this, "Specification of get_least_... call above");
   165   if (least != NULL && least->rank() <= special) {
   165   if (least != NULL && least->rank() <= special) {
   166     ::tty->print("Attempting to wait on monitor %s/%d while holding"
   166     ::tty->print("Attempting to wait on monitor %s/%d while holding"
   167                " lock %s/%d -- possible deadlock",
   167                " lock %s/%d -- possible deadlock",
   168                name(), rank(), least->name(), least->rank());
   168                name(), rank(), least->name(), least->rank());
   169     assert(false, "Shouldn't block(wait) while holding a lock of rank special");
   169     assert(false, "Shouldn't block(wait) while holding a lock of rank special");
   170   }
   170   }
   171   #endif // ASSERT
   171 #endif // ASSERT
       
   172 
       
   173 #ifdef CHECK_UNHANDLED_OOPS
       
   174   // Clear unhandled oops in JavaThreads so we get a crash right away.
       
   175   if (self->is_Java_thread() && !no_safepoint_check) {
       
   176     self->clear_unhandled_oops();
       
   177   }
       
   178 #endif // CHECK_UNHANDLED_OOPS
   172 
   179 
   173   int wait_status;
   180   int wait_status;
   174   // conceptually set the owner to NULL in anticipation of
   181   // conceptually set the owner to NULL in anticipation of
   175   // abdicating the lock in wait
   182   // abdicating the lock in wait
   176   set_owner(NULL);
   183   set_owner(NULL);