aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
diff options
context:
space:
mode:
authorGravatar Mark Schaller <mschaller@google.com>2015-11-17 16:57:35 +0000
committerGravatar Lukacs Berki <lberki@google.com>2015-11-18 15:30:00 +0000
commit4bbde148a9e71f3116a8051bc6f5bf5d0521adf2 (patch)
tree0ebcdffd3e83db00e2664145f5750bc35056e032 /src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
parent87063e5b27b893e00a99e2a39f4deb6818a9d284 (diff)
Return rdeps when marking a node dirty
The thread that succeeds at marking a node dirty during invalidation must then schedule that node's reverse deps for invalidation. Providing the set of reverse deps as a return value from marking a node dirty makes some future optimizations possible. -- MOS_MIGRATED_REVID=108045473
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.java6
1 files changed, 4 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 676b5374d4..ab8e0dcf43 100644
--- a/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
+++ b/src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
@@ -27,6 +27,7 @@ import com.google.devtools.build.lib.concurrent.ForkJoinQuiescingExecutor;
import com.google.devtools.build.lib.concurrent.QuiescingExecutor;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
import com.google.devtools.build.lib.util.Pair;
+import com.google.devtools.build.skyframe.ThinNodeEntry.MarkedDirtyResult;
import java.util.Collections;
import java.util.Map;
@@ -418,14 +419,15 @@ public abstract class InvalidatingNodeVisitor<TGraph extends ThinNodeQueryableGr
// It is not safe to interrupt the logic from this point until the end of the method.
// Any exception thrown should be unrecoverable.
// This entry remains in the graph in this dirty state until it is re-evaluated.
- if (!entry.markDirty(isChanged)) {
+ MarkedDirtyResult markedDirtyResult = entry.markDirty(isChanged);
+ if (markedDirtyResult == null) {
// Another thread has already dirtied this node. Don't do anything in this thread.
pendingVisitations.remove(invalidationPair);
return;
}
// Propagate dirtiness upwards and mark this node dirty/changed. Reverse deps should
// only be marked dirty (because only a dependency of theirs has changed).
- for (SkyKey reverseDep : entry.getReverseDeps()) {
+ for (SkyKey reverseDep : markedDirtyResult.getReverseDepsUnsafe()) {
visit(reverseDep, InvalidationType.DIRTIED, MUST_EXIST);
}