< prev index next >

src/hotspot/share/services/threadService.cpp

Print this page
*** 433,14 ***
          if (owner != NULL && // the raw monitor could be released at any time
              owner->is_Java_thread()) {
            currentThread = owner->as_Java_thread();
          }
        } else if (waitingToLockMonitor != NULL) {
!         address currentOwner = (address)waitingToLockMonitor->owner();
!         if (currentOwner != NULL) {
-           currentThread = Threads::owning_thread_from_monitor_owner(t_list,
-                                                                     currentOwner);
            if (currentThread == NULL) {
              // This function is called at a safepoint so the JavaThread
              // that owns waitingToLockMonitor should be findable, but
              // if it is not findable, then the previous currentThread is
              // blocked permanently. We record this as a deadlock.
--- 433,12 ---
          if (owner != NULL && // the raw monitor could be released at any time
              owner->is_Java_thread()) {
            currentThread = owner->as_Java_thread();
          }
        } else if (waitingToLockMonitor != NULL) {
!         if (waitingToLockMonitor->has_owner()) {
!           currentThread = Threads::owning_thread_from_monitor(t_list, waitingToLockMonitor);
            if (currentThread == NULL) {
              // This function is called at a safepoint so the JavaThread
              // that owns waitingToLockMonitor should be findable, but
              // if it is not findable, then the previous currentThread is
              // blocked permanently. We record this as a deadlock.

*** 1012,12 ***
                   obj->klass()->external_name());
  
        if (!currentThread->current_pending_monitor_is_from_java()) {
          owner_desc = "\n  in JNI, which is held by";
        }
!       currentThread = Threads::owning_thread_from_monitor_owner(t_list,
-                                                                 (address)waitingToLockMonitor->owner());
        if (currentThread == NULL) {
          // The deadlock was detected at a safepoint so the JavaThread
          // that owns waitingToLockMonitor should be findable, but
          // if it is not findable, then the previous currentThread is
          // blocked permanently.
--- 1010,11 ---
                   obj->klass()->external_name());
  
        if (!currentThread->current_pending_monitor_is_from_java()) {
          owner_desc = "\n  in JNI, which is held by";
        }
!       currentThread = Threads::owning_thread_from_monitor(t_list, waitingToLockMonitor);
        if (currentThread == NULL) {
          // The deadlock was detected at a safepoint so the JavaThread
          // that owns waitingToLockMonitor should be findable, but
          // if it is not findable, then the previous currentThread is
          // blocked permanently.
< prev index next >