src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java
changeset 54955 46409371a691
parent 47216 71c04702a3d5
equal deleted inserted replaced
54954:6ec71a88b68e 54955:46409371a691
     1 /*
     1 /*
     2  * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   144     private static ObjectHeap heap;
   144     private static ObjectHeap heap;
   145     private static HashMap threadTable;
   145     private static HashMap threadTable;
   146 
   146 
   147     private static void createThreadTable() {
   147     private static void createThreadTable() {
   148         threadTable = new HashMap();
   148         threadTable = new HashMap();
   149         for (JavaThread cur = threads.first(); cur != null; cur = cur.next()) {
   149         Threads threads = VM.getVM().getThreads();
       
   150         for (int i = 0; i < threads.getNumberOfThreads(); i++) {
       
   151             JavaThread cur = threads.getJavaThreadAt(i);
   150             // initialize dfn for each thread to -1
   152             // initialize dfn for each thread to -1
   151             threadTable.put(cur, new Integer(-1));
   153             threadTable.put(cur, new Integer(-1));
   152         }
   154         }
   153     }
   155     }
   154 
   156