comparison agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java @ 11996:22a5aff0df0b

8019396: SA-JDI OSThread class initialization throws an exception Summary: Method sun.jvm.hotspot.runtime.OSThread.initialize throws a sun.jvm.hotspot.types.WrongTypeException Reviewed-by: dholmes, mgerdin
author dsamersoff
date Tue, 06 Aug 2013 14:28:48 +0400
parents 43badbe2717a
children
comparison
equal deleted inserted replaced
11995:9064e3a19525 11996:22a5aff0df0b
30 30
31 // The OSThread class holds OS-specific thread information. It is equivalent 31 // The OSThread class holds OS-specific thread information. It is equivalent
32 // to the sys_thread_t structure of the classic JVM implementation. 32 // to the sys_thread_t structure of the classic JVM implementation.
33 public class OSThread extends VMObject { 33 public class OSThread extends VMObject {
34 private static JIntField interruptedField; 34 private static JIntField interruptedField;
35 private static JIntField threadIdField; 35 private static Field threadIdField;
36 static { 36 static {
37 VM.registerVMInitializedObserver(new Observer() { 37 VM.registerVMInitializedObserver(new Observer() {
38 public void update(Observable o, Object data) { 38 public void update(Observable o, Object data) {
39 initialize(VM.getVM().getTypeDataBase()); 39 initialize(VM.getVM().getTypeDataBase());
40 } 40 }
42 } 42 }
43 43
44 private static synchronized void initialize(TypeDataBase db) { 44 private static synchronized void initialize(TypeDataBase db) {
45 Type type = db.lookupType("OSThread"); 45 Type type = db.lookupType("OSThread");
46 interruptedField = type.getJIntField("_interrupted"); 46 interruptedField = type.getJIntField("_interrupted");
47 threadIdField = type.getJIntField("_thread_id"); 47 threadIdField = type.getField("_thread_id");
48 } 48 }
49 49
50 public OSThread(Address addr) { 50 public OSThread(Address addr) {
51 super(addr); 51 super(addr);
52 } 52 }
54 public boolean interrupted() { 54 public boolean interrupted() {
55 return ((int)interruptedField.getValue(addr)) != 0; 55 return ((int)interruptedField.getValue(addr)) != 0;
56 } 56 }
57 57
58 public int threadId() { 58 public int threadId() {
59 return (int)threadIdField.getValue(addr); 59 return threadIdField.getJInt(addr);
60 } 60 }
61 61
62 } 62 }