annotate agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java @ 2195:bf8517f4e4d0

6766644: Redefinition of compiled method fails with assertion "Can not load classes with the Compiler thread" Summary: Defer posting events from the compiler thread: use service thread Reviewed-by: coleenp, dholmes, never, dcubed
author kamg
date Wed, 02 Feb 2011 14:38:01 -0500
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
2 * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.runtime;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 /** This is a type-safe enum mirroring the JavaThreadState enum in
a61af66fc99e Initial load
duke
parents:
diff changeset
28 globalDefinitions.hpp. The conversion between the underlying ints
a61af66fc99e Initial load
duke
parents:
diff changeset
29 and these values is done in JavaThread. */
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 public class JavaThreadState {
a61af66fc99e Initial load
duke
parents:
diff changeset
32 private String stringVal;
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 /** Should never happen (missing initialization) */
a61af66fc99e Initial load
duke
parents:
diff changeset
35 public static final JavaThreadState UNINITIALIZED = new JavaThreadState("UNINITIALIZED");
a61af66fc99e Initial load
duke
parents:
diff changeset
36 /** Just starting up, i.e., in process of being initialized */
a61af66fc99e Initial load
duke
parents:
diff changeset
37 public static final JavaThreadState NEW = new JavaThreadState("NEW");
a61af66fc99e Initial load
duke
parents:
diff changeset
38 /** Corresponding transition state (not used, included for completness) */
a61af66fc99e Initial load
duke
parents:
diff changeset
39 public static final JavaThreadState NEW_TRANS = new JavaThreadState("NEW_TRANS");
a61af66fc99e Initial load
duke
parents:
diff changeset
40 /** Running in native code */
a61af66fc99e Initial load
duke
parents:
diff changeset
41 public static final JavaThreadState IN_NATIVE = new JavaThreadState("IN_NATIVE");
a61af66fc99e Initial load
duke
parents:
diff changeset
42 /** Corresponding transition state */
a61af66fc99e Initial load
duke
parents:
diff changeset
43 public static final JavaThreadState IN_NATIVE_TRANS = new JavaThreadState("IN_NATIVE_TRANS");
a61af66fc99e Initial load
duke
parents:
diff changeset
44 /** Running in VM */
a61af66fc99e Initial load
duke
parents:
diff changeset
45 public static final JavaThreadState IN_VM = new JavaThreadState("IN_VM");
a61af66fc99e Initial load
duke
parents:
diff changeset
46 /** Corresponding transition state */
a61af66fc99e Initial load
duke
parents:
diff changeset
47 public static final JavaThreadState IN_VM_TRANS = new JavaThreadState("IN_VM_TRANS");
a61af66fc99e Initial load
duke
parents:
diff changeset
48 /** Running in Java or in stub code */
a61af66fc99e Initial load
duke
parents:
diff changeset
49 public static final JavaThreadState IN_JAVA = new JavaThreadState("IN_JAVA");
a61af66fc99e Initial load
duke
parents:
diff changeset
50 /** Corresponding transition state (not used, included for completness) */
a61af66fc99e Initial load
duke
parents:
diff changeset
51 public static final JavaThreadState IN_JAVA_TRANS = new JavaThreadState("IN_JAVA_TRANS");
a61af66fc99e Initial load
duke
parents:
diff changeset
52 /** Blocked in vm */
a61af66fc99e Initial load
duke
parents:
diff changeset
53 public static final JavaThreadState BLOCKED = new JavaThreadState("BLOCKED");
a61af66fc99e Initial load
duke
parents:
diff changeset
54 /** Corresponding transition state */
a61af66fc99e Initial load
duke
parents:
diff changeset
55 public static final JavaThreadState BLOCKED_TRANS = new JavaThreadState("BLOCKED_TRANS");
a61af66fc99e Initial load
duke
parents:
diff changeset
56 /** Special state needed, since we cannot suspend a thread when it is in native_trans */
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 private JavaThreadState(String stringVal) {
a61af66fc99e Initial load
duke
parents:
diff changeset
59 this.stringVal = stringVal;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 }
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 public String toString() {
a61af66fc99e Initial load
duke
parents:
diff changeset
63 return stringVal;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 }
a61af66fc99e Initial load
duke
parents:
diff changeset
65 }