/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class VMState {
// Listeners
private final List<WeakReference> listeners = new ArrayList<WeakReference>(); // synchronized (this)
/*
* Certain information can be cached only when the entire VM is
* suspended and there are no pending resumes. The fields below
* are used to track whether there are pending resumes. (There
* is an assumption that JDWP command ids are increasing over time.)
*/
// This is cached only while the VM is suspended
private static class Cache {
}
private void disableCache() {
synchronized (this) {
}
}
private void enableCache() {
synchronized (this) {
cache = markerCache;
}
}
synchronized (this) {
if (cache == markerCache) {
}
return cache;
}
}
}
/**
* Is the VM currently suspended, for the purpose of caching?
* Must be called synchronized on vm.state()
*/
boolean isSuspended() {
}
/*
* A JDWP command has been completed (reply has been received).
* Update data that tracks pending resume commands.
*/
}
synchronized void freeze() {
/*
* No pending resumes to worry about. The VM is suspended
* and additional state can be cached. Notify all
* interested listeners.
*/
enableCache();
}
}
thaw();
return stream;
}
/**
* All threads are resuming
*/
void thaw() {
}
/**
* Tell listeners to invalidate suspend-sensitive caches.
* If resumingThread != null, then only that thread is being
* resumed.
*/
}
disableCache();
}
}
if (!notifyingListeners) {
// Prevent recursion
notifyingListeners = true;
boolean keep = true;
case VMAction.VM_SUSPENDED:
break;
case VMAction.VM_NOT_SUSPENDED:
break;
}
if (!keep) {
}
} else {
// Listener is unreachable; clean up
}
}
notifyingListeners = false;
}
}
}
}
break;
}
}
}
try {
// may be stale when returned, but not provably so
}
}
}
}
} catch (JDWPException exc) {
throw exc.toJDIException();
}
return threads;
}
try {
}
"Caching top level thread groups (count = " +
}
}
}
} catch (JDWPException exc) {
throw exc.toJDIException();
}
return groups;
}
}