mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Git: semaphore.up() in startFailed() and in finally block.
This fixes IDEA-75312 and should fix IDEA-75490
This commit is contained in:
@@ -218,8 +218,11 @@ public class GitSimpleHandler extends GitTextHandler {
|
||||
}
|
||||
|
||||
public void startFailed(final Throwable exception) {
|
||||
ex[0] = new VcsException("Process failed to start (" + myCommandLine.getCommandLineString() + "): " + exception.toString(), exception);
|
||||
sem.release();
|
||||
try {
|
||||
ex[0] = new VcsException("Process failed to start (" + myCommandLine.getCommandLineString() + "): " + exception.toString(), exception);
|
||||
} finally {
|
||||
sem.release();
|
||||
}
|
||||
}
|
||||
});
|
||||
GitHandlerUtil.runInCurrentThread(this, null);
|
||||
|
||||
@@ -68,10 +68,13 @@ public abstract class GitTextHandler extends GitHandler {
|
||||
|
||||
public void processTerminated(final ProcessEvent event) {
|
||||
final int exitCode = event.getExitCode();
|
||||
setExitCode(exitCode);
|
||||
cleanupEnv();
|
||||
GitTextHandler.this.processTerminated(exitCode);
|
||||
listeners().processTerminated(exitCode);
|
||||
try {
|
||||
setExitCode(exitCode);
|
||||
cleanupEnv();
|
||||
GitTextHandler.this.processTerminated(exitCode);
|
||||
} finally {
|
||||
listeners().processTerminated(exitCode);
|
||||
}
|
||||
}
|
||||
|
||||
public void processWillTerminate(final ProcessEvent event, final boolean willBeDestroyed) {
|
||||
|
||||
@@ -223,6 +223,7 @@ public class GitHistoryUtils {
|
||||
}
|
||||
@Override
|
||||
public void startFailed(Throwable exception) {
|
||||
semaphore.up();
|
||||
}
|
||||
});
|
||||
semaphore.down();
|
||||
@@ -356,18 +357,24 @@ public class GitHistoryUtils {
|
||||
@Override
|
||||
public void startFailed(Throwable exception) {
|
||||
//noinspection ThrowableInstanceNeverThrown
|
||||
exceptionConsumer.consume(new VcsException(exception));
|
||||
semaphore.up();
|
||||
try {
|
||||
exceptionConsumer.consume(new VcsException(exception));
|
||||
} finally {
|
||||
semaphore.up();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processTerminated(int exitCode) {
|
||||
super.processTerminated(exitCode);
|
||||
final GitLogRecord record = accumulator.processLast();
|
||||
if (record != null) {
|
||||
resultAdapter.consume(record);
|
||||
try {
|
||||
super.processTerminated(exitCode);
|
||||
final GitLogRecord record = accumulator.processLast();
|
||||
if (record != null) {
|
||||
resultAdapter.consume(record);
|
||||
}
|
||||
} finally {
|
||||
semaphore.up();
|
||||
}
|
||||
semaphore.up();
|
||||
}
|
||||
});
|
||||
semaphore.down();
|
||||
@@ -607,6 +614,7 @@ public class GitHistoryUtils {
|
||||
}
|
||||
@Override
|
||||
public void startFailed(Throwable exception) {
|
||||
semaphore.up();
|
||||
}
|
||||
});
|
||||
semaphore.down();
|
||||
@@ -821,7 +829,7 @@ public class GitHistoryUtils {
|
||||
|
||||
@Override
|
||||
public void startFailed(Throwable exception) {
|
||||
// todo
|
||||
semaphore.up();
|
||||
}
|
||||
});
|
||||
semaphore.down();
|
||||
|
||||
Reference in New Issue
Block a user