org.eclipse.core.internal.jobs.Deadlock Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aspectjtools Show documentation
Show all versions of aspectjtools Show documentation
AspectJ tools most notably contains the AspectJ compiler (AJC). AJC applies aspects to Java classes during
compilation, fully replacing Javac for plain Java classes and also compiling native AspectJ or annotation-based
@AspectJ syntax. Furthermore, AJC can weave aspects into existing class files in a post-compile binary weaving step.
This library is a superset of AspectJ weaver and hence also of AspectJ runtime.
/*******************************************************************************
* Copyright (c) 2003, 2023 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM - Initial API and implementation
*******************************************************************************/
package org.eclipse.core.internal.jobs;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
/**
* The deadlock class stores information about a deadlock that just occurred.
* It contains an array of the threads that were involved in the deadlock
* as well as the thread that was chosen to be suspended and an array of locks
* held by that thread that are going to be suspended to resolve the deadlock.
*/
class Deadlock {
//all the threads which are involved in the deadlock
private final Thread[] threads;
//the thread whose locks will be suspended to resolve deadlock
private final Thread candidate;
//the locks that will be suspended
private final ISchedulingRule[] locks;
public Deadlock(Thread[] threads, ISchedulingRule[] locks, Thread candidate) {
this.threads = threads;
this.locks = locks;
this.candidate = candidate;
}
public ISchedulingRule[] getLocks() {
return locks;
}
public Thread getCandidate() {
return candidate;
}
public Thread[] getThreads() {
return threads;
}
}