mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
VCS: kill local changes gathering (project level) thread
This commit is contained in:
@@ -34,6 +34,7 @@ public class ExecutorWrapper {
|
||||
private final Object myLock;
|
||||
private boolean myInProgress;
|
||||
private Runnable myStopper;
|
||||
private Thread myCurrentWorker;
|
||||
private AtomicSectionsAware myAtomicSectionsAware;
|
||||
|
||||
protected ExecutorWrapper(final Project project, final String name) {
|
||||
@@ -46,6 +47,9 @@ public class ExecutorWrapper {
|
||||
public void run() {
|
||||
synchronized (myLock) {
|
||||
myDisposeStarted = true;
|
||||
if (myCurrentWorker != null) {
|
||||
myCurrentWorker.interrupt();
|
||||
}
|
||||
taskFinished();
|
||||
}
|
||||
}
|
||||
@@ -72,6 +76,7 @@ public class ExecutorWrapper {
|
||||
|
||||
private void taskFinished() {
|
||||
synchronized (myLock) {
|
||||
myCurrentWorker = null;
|
||||
if (myInProgress) {
|
||||
myInProgress = false;
|
||||
mySemaphore.up();
|
||||
@@ -93,6 +98,9 @@ public class ExecutorWrapper {
|
||||
}
|
||||
ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
|
||||
public void run() {
|
||||
synchronized (myLock) {
|
||||
myCurrentWorker = Thread.currentThread();
|
||||
}
|
||||
try {
|
||||
runnable.consume(myAtomicSectionsAware);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user