src/hotspot/share/runtime/mutex.cpp
changeset 57745 789e967c2731
parent 57699 4aea554692aa
child 57751 7284b00e6db3
equal deleted inserted replaced
57739:6717d7e59db4 57745:789e967c2731
    48 #endif // ASSERT
    48 #endif // ASSERT
    49 
    49 
    50 void Monitor::lock(Thread * self) {
    50 void Monitor::lock(Thread * self) {
    51   check_safepoint_state(self, true);
    51   check_safepoint_state(self, true);
    52 
    52 
    53 #ifdef CHECK_UNHANDLED_OOPS
       
    54   // Clear unhandled oops in JavaThreads so we get a crash right away.
       
    55   if (self->is_active_Java_thread()) {
       
    56     self->clear_unhandled_oops();
       
    57   }
       
    58 #endif // CHECK_UNHANDLED_OOPS
       
    59 
       
    60   DEBUG_ONLY(check_prelock_state(self, true));
    53   DEBUG_ONLY(check_prelock_state(self, true));
    61   assert(_owner != self, "invariant");
    54   assert(_owner != self, "invariant");
    62 
    55 
    63   Monitor* in_flight_monitor = NULL;
    56   Monitor* in_flight_monitor = NULL;
    64   DEBUG_ONLY(int retry_cnt = 0;)
    57   DEBUG_ONLY(int retry_cnt = 0;)
   193   assert_owner(self);
   186   assert_owner(self);
   194 
   187 
   195   // Safepoint checking logically implies an active JavaThread.
   188   // Safepoint checking logically implies an active JavaThread.
   196   guarantee(self->is_active_Java_thread(), "invariant");
   189   guarantee(self->is_active_Java_thread(), "invariant");
   197   assert_wait_lock_state(self);
   190   assert_wait_lock_state(self);
   198 
       
   199 #ifdef CHECK_UNHANDLED_OOPS
       
   200   // Clear unhandled oops in JavaThreads so we get a crash right away.
       
   201   self->clear_unhandled_oops();
       
   202 #endif // CHECK_UNHANDLED_OOPS
       
   203 
   191 
   204   int wait_status;
   192   int wait_status;
   205   // conceptually set the owner to NULL in anticipation of
   193   // conceptually set the owner to NULL in anticipation of
   206   // abdicating the lock in wait
   194   // abdicating the lock in wait
   207   set_owner(NULL);
   195   set_owner(NULL);