From 7281d44b8b129ac91b1eb3b60fb08ba0cf62b890 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Mon, 23 Apr 2012 15:31:18 +0400 Subject: [PATCH] Git.runInBackground: don't use the queue. The most of Git activity is produce by commands invoked by the user. In this case there is no sense in making the user wait until the previous command is completed (for example, fetch can take a very long time, why should I wait for it to see the history of a file?) Most of the others (e.g. in GitChangeProvider or GitUpdateProcess) are executed in their own general VCS processes. The write-lock is taken anyway globally in GitHandler when needed. --- plugins/git4idea/src/git4idea/GitVcs.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/git4idea/src/git4idea/GitVcs.java b/plugins/git4idea/src/git4idea/GitVcs.java index 7dd147df97cb..a5a1dddf2796 100644 --- a/plugins/git4idea/src/git4idea/GitVcs.java +++ b/plugins/git4idea/src/git4idea/GitVcs.java @@ -127,7 +127,6 @@ public class GitVcs extends AbstractVcs { private GitVFSListener myVFSListener; // a VFS listener that tracks file addition, deletion, and renaming. - private final BackgroundTaskQueue myTaskQueue; // The queue that is used to schedule background task from actions private final ReadWriteLock myCommandLock = new ReentrantReadWriteLock(true); // The command read/write lock private final TreeDiffProvider myTreeDiffProvider; private final GitCommitAndPushExecutor myCommitAndPushExecutor; @@ -172,7 +171,6 @@ public class GitVcs extends AbstractVcs { myOutgoingChangesProvider = new GitOutgoingChangesProvider(myProject); myTreeDiffProvider = new GitTreeDiffProvider(myProject); myCommitAndPushExecutor = new GitCommitAndPushExecutor(myCheckinEnvironment); - myTaskQueue = new BackgroundTaskQueue(myProject, GitBundle.getString("task.queue.title")); myExecutableValidator = new GitExecutableValidator(myProject, this); myPlatformFacade = ServiceManager.getService(myProject, PlatformFacade.class); } @@ -187,10 +185,7 @@ public class GitVcs extends AbstractVcs { * @param task the task to run */ public static void runInBackground(Task.Backgroundable task) { - GitVcs vcs = getInstance(task.getProject()); - if (vcs != null) { - vcs.myTaskQueue.run(task); - } + task.queue(); } /**