agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
Print this page
*** 217,227 ****
private static void initThreadFields() {
if (threadNameField == null) {
SystemDictionary sysDict = VM.getVM().getSystemDictionary();
InstanceKlass k = sysDict.getThreadKlass();
! threadNameField = (OopField) k.findField("name", "[C");
threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;");
threadEETopField = (LongField) k.findField("eetop", "J");
threadTIDField = (LongField) k.findField("tid", "J");
threadStatusField = (IntField) k.findField("threadStatus", "I");
threadParkBlockerField = (OopField) k.findField("parkBlocker",
--- 217,227 ----
private static void initThreadFields() {
if (threadNameField == null) {
SystemDictionary sysDict = VM.getVM().getSystemDictionary();
InstanceKlass k = sysDict.getThreadKlass();
! threadNameField = (OopField) k.findField("name", "Ljava/lang/String;");
threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;");
threadEETopField = (LongField) k.findField("eetop", "J");
threadTIDField = (LongField) k.findField("tid", "J");
threadStatusField = (IntField) k.findField("threadStatus", "I");
threadParkBlockerField = (OopField) k.findField("parkBlocker",
*** 256,266 ****
return threadGroupField.getValue(threadOop);
}
public static String threadOopGetName(Oop threadOop) {
initThreadFields();
! return charArrayToString((TypeArray) threadNameField.getValue(threadOop));
}
/** May return null if, e.g., thread was not started */
public static JavaThread threadOopGetJavaThread(Oop threadOop) {
initThreadFields();
--- 256,266 ----
return threadGroupField.getValue(threadOop);
}
public static String threadOopGetName(Oop threadOop) {
initThreadFields();
! return stringOopToString(threadNameField.getValue(threadOop));
}
/** May return null if, e.g., thread was not started */
public static JavaThread threadOopGetJavaThread(Oop threadOop) {
initThreadFields();