mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[debugger] Exclude technical threads from debugger model check
EA-1315500 EA-1329448 GitOrigin-RevId: 708894508fc5c3c967e1fc049462b11d8d963122
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d13b703502
commit
94e3c00eaa
@@ -61,6 +61,9 @@ object DebuggerDiagnosticsUtil {
|
||||
val problems = mutableListOf<String>()
|
||||
|
||||
for (threadProxy in allThreads) {
|
||||
if (threadProxy.isIgnoreModelSuspendCount) {
|
||||
continue
|
||||
}
|
||||
val suspendingContexts = SuspendManagerUtil.getSuspendingContexts(suspendManager, threadProxy)
|
||||
val resumedByWatching = if (invocationWatching != null && suspendingContexts.contains(invocationWatching.mySuspendAllContext)) 1
|
||||
else 0
|
||||
|
||||
@@ -98,7 +98,10 @@ class ReloadClassesWorker {
|
||||
virtualMachineProxy.allThreads().stream()
|
||||
.filter(ThreadReferenceProxyImpl::isResumeOnHotSwap)
|
||||
.filter(ThreadReferenceProxyImpl::isSuspended)
|
||||
.forEach(t -> IntStream.range(0, t.getSuspendCount()).forEach(i -> t.resume()));
|
||||
.forEach(t -> IntStream.range(0, t.getSuspendCount()).forEach(i -> {
|
||||
t.setIgnoreModelSuspendCount(true);
|
||||
t.resume();
|
||||
}));
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -48,7 +48,10 @@ public final class ThreadReferenceProxyImpl extends ObjectReferenceProxyImpl imp
|
||||
private volatile boolean myIsEvaluating = false;
|
||||
|
||||
// This counter can go negative value if the engine stops the whole JVM, but resumed this particular thread
|
||||
public int myModelSuspendCount = 0;
|
||||
private int myModelSuspendCount = 0;
|
||||
|
||||
// This counter can go negative value if the engine stops the whole JVM, but resumed this particular thread
|
||||
private boolean myIsIgnoreModelSuspendCount = false;
|
||||
|
||||
public static final Comparator<ThreadReferenceProxyImpl> ourComparator = (th1, th2) -> {
|
||||
int res = Boolean.compare(th2.isSuspended(), th1.isSuspended());
|
||||
@@ -508,6 +511,16 @@ public final class ThreadReferenceProxyImpl extends ObjectReferenceProxyImpl imp
|
||||
}
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
public boolean isIgnoreModelSuspendCount() {
|
||||
return myIsIgnoreModelSuspendCount;
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
public void setIgnoreModelSuspendCount(boolean ignoreModelSuspendCount) {
|
||||
myIsIgnoreModelSuspendCount = ignoreModelSuspendCount;
|
||||
}
|
||||
|
||||
public interface ThreadListener extends EventListener{
|
||||
default void threadSuspended() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user