[java] restoring "dump threads" action availability on Windows

(cherry picked from commit 366fdffea056fd6896c090fae654d5c28f7289d4)

IJ-CR-155182

GitOrigin-RevId: d11412fa3094bf24ca495d1e6a504c5d4f922f11
This commit is contained in:
Roman Shevchenko
2025-02-14 14:42:49 +01:00
committed by intellij-monorepo-bot
parent e7a6ad4826
commit 89cd6761b4

View File

@@ -59,10 +59,7 @@ final class ProcessProxyImpl implements ProcessProxy {
public void attach(@NotNull ProcessHandler processHandler) {
processHandler.putUserData(KEY, this);
execute(() -> {
int pid = -1;
if (SystemInfo.isUnix && processHandler instanceof BaseOSProcessHandler) {
pid = (int)((BaseOSProcessHandler)processHandler).getProcess().pid();
}
int pid = processHandler instanceof BaseOSProcessHandler bh ? (int)bh.getProcess().pid() : -1;
synchronized (myLock) {
myPid = pid;
}
@@ -81,13 +78,9 @@ final class ProcessProxyImpl implements ProcessProxy {
@Override
public boolean canSendBreak() {
if (SystemInfo.isUnix) {
synchronized (myLock) {
return myPid > 0;
}
synchronized (myLock) {
return myPid > 0;
}
return false;
}
@Override