diff -r 01684f7fee1b src/share/vm/services/threadService.cpp
--- a/src/share/vm/services/threadService.cpp	Fri Nov 16 09:36:41 2012 -0800
+++ b/src/share/vm/services/threadService.cpp	Tue Nov 27 17:59:47 2012 +0200
@@ -293,7 +293,7 @@
   ObjectMonitor* waitingToLockMonitor = NULL;
   oop waitingToLockBlocker = NULL;
   bool blocked_on_monitor = false;
-  JavaThread *currentThread, *previousThread;
+  JavaThread *currentThread;
   int num_deadlocks = 0;
 
   for (JavaThread* p = Threads::first(); p != NULL; p = p->next()) {
@@ -312,7 +312,6 @@
 
     thisDfn = globalDfn;
     jt->set_depth_first_number(globalDfn++);
-    previousThread = jt;
     currentThread = jt;
 
     cycle->reset();
@@ -350,9 +349,6 @@
       } else if (currentThread->depth_first_number() < thisDfn) {
         // Thread already visited, and not on a (new) cycle
         break;
-      } else if (currentThread == previousThread) {
-        // Self-loop, ignore
-        break;
       } else {
         // We have a (new) cycle
         num_deadlocks++;
@@ -369,7 +365,6 @@
         cycle = new DeadlockCycle();
         break;
       }
-      previousThread = currentThread;
       waitingToLockMonitor = (ObjectMonitor*)currentThread->current_pending_monitor();
       if (concurrent_locks) {
         waitingToLockBlocker = currentThread->current_park_blocker();
