agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java	Thu Jan 31 17:36:35 2013
--- new/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java	Thu Jan 31 17:36:35 2013

*** 1,7 **** --- 1,7 ---- /* ! * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 30,39 **** --- 30,40 ---- // The OSThread class holds OS-specific thread information. It is equivalent // to the sys_thread_t structure of the classic JVM implementation. public class OSThread extends VMObject { private static JIntField interruptedField; + private static JIntField threadIdField; static { VM.registerVMInitializedObserver(new Observer() { public void update(Observable o, Object data) { initialize(VM.getVM().getTypeDataBase()); }
*** 41,55 **** --- 42,62 ---- } private static synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("OSThread"); interruptedField = type.getJIntField("_interrupted"); + threadIdField = type.getJIntField("_thread_id"); } public OSThread(Address addr) { super(addr); } public boolean interrupted() { return ((int)interruptedField.getValue(addr)) != 0; } + + public int threadId() { + return (int)threadIdField.getValue(addr); + } + }

agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File