src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadState.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 46636 hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadState.java@26b8de0359a0
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46636
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
     1
/*
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
     2
 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
     4
 *
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
     7
 * published by the Free Software Foundation.
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
     8
 *
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    13
 * accompanied this code).
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    14
 *
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    18
 *
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    21
 * questions.
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    22
 */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    23
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    24
package sun.jvm.hotspot.runtime;
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    25
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    26
/** This is a type-safe enum mirroring the ThreadState enum in
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    27
 osThread.hpp. The conversion between the underlying ints
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    28
 and these values is done in OSThread. */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    29
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    30
public class ThreadState {
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    31
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    32
    private String printVal;
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    33
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    34
    /** Memory has been allocated but not initialized */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    35
    public static final ThreadState ALLOCATED = new ThreadState("allocated");
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    36
    /** The thread has been initialized but yet started */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    37
    public static final ThreadState INITIALIZED = new ThreadState("initialized");
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    38
    /** Has been started and is runnable, but not necessarily running */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    39
    public static final ThreadState RUNNABLE = new ThreadState("runnable");
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    40
    /** Waiting on a contended monitor lock */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    41
    public static final ThreadState MONITOR_WAIT = new ThreadState("waiting for monitor entry");
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    42
    /** Waiting on a condition variable */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    43
    public static final ThreadState CONDVAR_WAIT = new ThreadState("waiting on condition");
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    44
    /** Waiting on an Object.wait() call */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    45
    public static final ThreadState OBJECT_WAIT = new ThreadState("in Object.wait()");
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    46
    /** Suspended at breakpoint */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    47
    public static final ThreadState BREAKPOINTED = new ThreadState("at breakpoint");
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    48
    /** Thread.sleep() */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    49
    public static final ThreadState SLEEPING = new ThreadState("sleeping");
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    50
    /** All done, but not reclaimed yet */
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    51
    public static final ThreadState ZOMBIE = new ThreadState("zombie");
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    52
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    53
    private ThreadState(String printVal){
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    54
        this.printVal = printVal;
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    55
    }
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    56
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    57
    public String getPrintVal() {
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    58
        return printVal;
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    59
    }
26b8de0359a0 8181647: jhsdb jstack could not output thread name
dbuck
parents:
diff changeset
    60
}