src/share/classes/java/lang/management/ThreadInfo.java

Print this page




 130         initialize(t, state, lockObj, lockOwner,
 131                    blockedCount, blockedTime,
 132                    waitedCount, waitedTime, stackTrace,
 133                    EMPTY_MONITORS, EMPTY_SYNCS);
 134     }
 135 
 136     /**
 137      * Constructor of ThreadInfo created by the JVM
 138      * for {@link ThreadMXBean#getThreadInfo(long[],boolean,boolean)}
 139      * and {@link ThreadMXBean#dumpAllThreads}
 140      *
 141      * @param t             Thread
 142      * @param state         Thread state
 143      * @param lockObj       Object on which the thread is blocked
 144      * @param lockOwner     the thread holding the lock
 145      * @param blockedCount  Number of times blocked to enter a lock
 146      * @param blockedTime   Approx time blocked to enter a lock
 147      * @param waitedCount   Number of times waited on a lock
 148      * @param waitedTime    Approx time waited on a lock
 149      * @param stackTrace    Thread stack trace
 150      * @param lockedMonitors List of locked monitors
 151      * @param lockedSynchronizers List of locked synchronizers

 152      */
 153     private ThreadInfo(Thread t, int state, Object lockObj, Thread lockOwner,
 154                        long blockedCount, long blockedTime,
 155                        long waitedCount, long waitedTime,
 156                        StackTraceElement[] stackTrace,
 157                        Object[] monitors,
 158                        int[] stackDepths,
 159                        Object[] synchronizers) {
 160         int numMonitors = (monitors == null ? 0 : monitors.length);
 161         MonitorInfo[] lockedMonitors;
 162         if (numMonitors == 0) {
 163             lockedMonitors = EMPTY_MONITORS;
 164         } else {
 165             lockedMonitors = new MonitorInfo[numMonitors];
 166             for (int i = 0; i < numMonitors; i++) {
 167                 Object lock = monitors[i];
 168                 String className = lock.getClass().getName();
 169                 int identityHashCode = System.identityHashCode(lock);
 170                 int depth = stackDepths[i];
 171                 StackTraceElement ste = (depth >= 0 ? stackTrace[depth]




 130         initialize(t, state, lockObj, lockOwner,
 131                    blockedCount, blockedTime,
 132                    waitedCount, waitedTime, stackTrace,
 133                    EMPTY_MONITORS, EMPTY_SYNCS);
 134     }
 135 
 136     /**
 137      * Constructor of ThreadInfo created by the JVM
 138      * for {@link ThreadMXBean#getThreadInfo(long[],boolean,boolean)}
 139      * and {@link ThreadMXBean#dumpAllThreads}
 140      *
 141      * @param t             Thread
 142      * @param state         Thread state
 143      * @param lockObj       Object on which the thread is blocked
 144      * @param lockOwner     the thread holding the lock
 145      * @param blockedCount  Number of times blocked to enter a lock
 146      * @param blockedTime   Approx time blocked to enter a lock
 147      * @param waitedCount   Number of times waited on a lock
 148      * @param waitedTime    Approx time waited on a lock
 149      * @param stackTrace    Thread stack trace
 150      * @param monitors      List of locked monitors
 151      * @param stackDepths   List of stack depths
 152      * @param synchronizers List of locked synchronizers
 153      */
 154     private ThreadInfo(Thread t, int state, Object lockObj, Thread lockOwner,
 155                        long blockedCount, long blockedTime,
 156                        long waitedCount, long waitedTime,
 157                        StackTraceElement[] stackTrace,
 158                        Object[] monitors,
 159                        int[] stackDepths,
 160                        Object[] synchronizers) {
 161         int numMonitors = (monitors == null ? 0 : monitors.length);
 162         MonitorInfo[] lockedMonitors;
 163         if (numMonitors == 0) {
 164             lockedMonitors = EMPTY_MONITORS;
 165         } else {
 166             lockedMonitors = new MonitorInfo[numMonitors];
 167             for (int i = 0; i < numMonitors; i++) {
 168                 Object lock = monitors[i];
 169                 String className = lock.getClass().getName();
 170                 int identityHashCode = System.identityHashCode(lock);
 171                 int depth = stackDepths[i];
 172                 StackTraceElement ste = (depth >= 0 ? stackTrace[depth]