aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
diff options
context:
space:
mode:
authorGravatar Eric Fellheimer <felly@google.com>2016-01-29 00:18:29 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-01-29 14:42:03 +0000
commit1c6a0c9afde784886f9c011483afc1523e66fcf9 (patch)
tree05e79c34a708fd62da8bc6cd0c0fda710803b838 /src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
parent6f8b7ce7c8058e88280394cdf3938d1dd6511b8f (diff)
Parallelize top-level invalidation. No need to do all of these in sequence.
-- MOS_MIGRATED_REVID=113313675
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java')
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java b/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
index 76ced5fa20..06ff375fae 100644
--- a/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
+++ b/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
@@ -139,11 +139,17 @@ public abstract class InvalidatingNodeVisitor<TGraph extends ThinNodeQueryableGr
// Make a copy to avoid concurrent modification confusing us as to which nodes were passed by
// the caller, and which are added by other threads during the run. Since no tasks have been
// started yet (the queueDirtying calls start them), this is thread-safe.
- for (Pair<SkyKey, InvalidationType> visitData : ImmutableList.copyOf(pendingVisitations)) {
+ for (final Pair<SkyKey, InvalidationType> visitData :
+ ImmutableList.copyOf(pendingVisitations)) {
// The caller may have specified non-existent SkyKeys, or there may be stale SkyKeys in
// pendingVisitations that have already been deleted. In both these cases, the nodes will not
// exist in the graph, so we must be tolerant of that case.
- visit(ImmutableList.of(visitData.first), visitData.second, !MUST_EXIST);
+ executor.execute(new Runnable() {
+ @Override
+ public void run() {
+ visit(ImmutableList.of(visitData.first), visitData.second, !MUST_EXIST);
+ }
+ });
}
executor.awaitQuiescence(/*interruptWorkers=*/ true);