3475N/A * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1472N/A * or visit www.oracle.com if you need additional information or have any 0N/A/** A utility class encapsulating useful oop operations */ 0N/A // FIXME: access should be synchronized and cleared when VM is 0N/A // ThreadGroup fields 0N/A // threadStatus field is new since 1.5 0N/A // parkBlocker field is new since 1.6 0N/A // possible values of java_lang_Thread::ThreadStatus 0N/A Other enum constants are not needed as of now. Uncomment these as and when needed. 0N/A private static int THREAD_STATUS_RUNNABLE; 0N/A private static int THREAD_STATUS_SLEEPING; 0N/A private static int THREAD_STATUS_IN_OBJECT_WAIT; 0N/A private static int THREAD_STATUS_IN_OBJECT_WAIT_TIMED; 0N/A private static int THREAD_STATUS_PARKED; 0N/A private static int THREAD_STATUS_PARKED_TIMED; 0N/A private static int THREAD_STATUS_BLOCKED_ON_MONITOR_ENTER; 0N/A private static int THREAD_STATUS_TERMINATED; 0N/A // java.util.concurrent.locks.AbstractOwnableSynchronizer fields 0N/A // FIXME: don't need this observer; however, do need a VM resumed 0N/A // and suspended observer to refetch fields 0N/A Other enum constants are not needed as of now. Uncomment these as and when needed. 0N/A THREAD_STATUS_RUNNABLE = db.lookupIntConstant("java_lang_Thread::RUNNABLE").intValue(); 0N/A THREAD_STATUS_SLEEPING = db.lookupIntConstant("java_lang_Thread::SLEEPING").intValue(); 0N/A THREAD_STATUS_IN_OBJECT_WAIT = db.lookupIntConstant("java_lang_Thread::IN_OBJECT_WAIT").intValue(); 0N/A THREAD_STATUS_IN_OBJECT_WAIT_TIMED = db.lookupIntConstant("java_lang_Thread::IN_OBJECT_WAIT_TIMED").intValue(); 0N/A THREAD_STATUS_PARKED = db.lookupIntConstant("java_lang_Thread::PARKED").intValue(); 0N/A THREAD_STATUS_PARKED_TIMED = db.lookupIntConstant("java_lang_Thread::PARKED_TIMED").intValue(); 0N/A THREAD_STATUS_BLOCKED_ON_MONITOR_ENTER = db.lookupIntConstant("java_lang_Thread::BLOCKED_ON_MONITOR_ENTER").intValue(); 0N/A THREAD_STATUS_TERMINATED = db.lookupIntConstant("java_lang_Thread::TERMINATED").intValue(); 0N/A // it is okay to miss threadStatusField, because this was 0N/A // introduced only in 1.5 JDK. 0N/A /** May return null if, e.g., thread was not started */ 0N/A /** returns value of java.lang.Thread.threadStatus field */ 0N/A // The threadStatus is only present starting in 1.5 0N/A // All we can easily figure out is if it is alive, but that is 0N/A // enough info for a valid unknown status. 0N/A // the thread hasn't run yet or is in the process of exiting 0N/A /** returns value of java.lang.Thread.parkBlocker field */ 0N/A // initialize fields for j.u.c.l AbstractOwnableSynchornizer class 0N/A // return exclusiveOwnerThread field of AbstractOwnableSynchronizer class